@lamentis/naome 1.3.0 → 1.3.1
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 +11 -2
- package/bin/naome.js +62 -24
- package/crates/naome-cli/Cargo.toml +1 -1
- package/crates/naome-cli/src/context_commands.rs +47 -0
- package/crates/naome-cli/src/dispatcher.rs +6 -0
- package/crates/naome-cli/src/main.rs +43 -6
- package/crates/naome-cli/src/quality_commands.rs +31 -46
- package/crates/naome-cli/src/quality_output.rs +34 -0
- package/crates/naome-cli/src/quality_reconcile_command.rs +45 -0
- package/crates/naome-cli/src/repository_model_commands.rs +84 -0
- package/crates/naome-cli/src/task_commands.rs +62 -0
- package/crates/naome-cli/src/workflow_commands.rs +100 -3
- package/crates/naome-core/Cargo.toml +1 -1
- package/crates/naome-core/src/context/helpers.rs +75 -0
- package/crates/naome-core/src/context/select.rs +134 -0
- package/crates/naome-core/src/context/types.rs +43 -0
- package/crates/naome-core/src/context.rs +6 -0
- package/crates/naome-core/src/decision/states.rs +1 -1
- package/crates/naome-core/src/decision.rs +4 -1
- package/crates/naome-core/src/install_plan.rs +18 -0
- package/crates/naome-core/src/journal.rs +2 -7
- package/crates/naome-core/src/lib.rs +33 -10
- package/crates/naome-core/src/quality/adapter_ios.rs +131 -0
- package/crates/naome-core/src/quality/adapter_support.rs +67 -0
- package/crates/naome-core/src/quality/adapters.rs +81 -18
- package/crates/naome-core/src/quality/cache.rs +7 -9
- package/crates/naome-core/src/quality/checks/duplicate_blocks.rs +4 -7
- package/crates/naome-core/src/quality/config.rs +21 -3
- package/crates/naome-core/src/quality/mod.rs +138 -7
- package/crates/naome-core/src/quality/reconcile.rs +138 -0
- package/crates/naome-core/src/quality/reconcile_anchors.rs +64 -0
- package/crates/naome-core/src/quality/scanner/analysis.rs +20 -5
- package/crates/naome-core/src/quality/scanner.rs +62 -17
- package/crates/naome-core/src/quality/semantic/checks.rs +17 -0
- package/crates/naome-core/src/quality/semantic/route.rs +1 -1
- package/crates/naome-core/src/quality/structure/adapter_ios.rs +149 -0
- package/crates/naome-core/src/quality/structure/adapters.rs +60 -42
- package/crates/naome-core/src/quality/structure/checks/directory.rs +6 -4
- package/crates/naome-core/src/quality/structure/classify/roles.rs +51 -5
- package/crates/naome-core/src/quality/structure/config.rs +24 -3
- package/crates/naome-core/src/quality/structure/mod.rs +3 -0
- package/crates/naome-core/src/quality/types.rs +20 -1
- package/crates/naome-core/src/repository_model/detect.rs +188 -0
- package/crates/naome-core/src/repository_model/explain.rs +121 -0
- package/crates/naome-core/src/repository_model/path_scan.rs +67 -0
- package/crates/naome-core/src/repository_model/path_support.rs +59 -0
- package/crates/naome-core/src/repository_model/types.rs +152 -0
- package/crates/naome-core/src/repository_model/world.rs +48 -0
- package/crates/naome-core/src/repository_model/world_adapters.rs +145 -0
- package/crates/naome-core/src/repository_model/world_path_facts.rs +55 -0
- package/crates/naome-core/src/repository_model/world_paths.rs +168 -0
- package/crates/naome-core/src/repository_model.rs +164 -0
- package/crates/naome-core/src/route/builtin_checks.rs +40 -1
- package/crates/naome-core/src/task_ledger/import.rs +142 -0
- package/crates/naome-core/src/task_ledger/model.rs +13 -0
- package/crates/naome-core/src/task_ledger/proof_record.rs +52 -0
- package/crates/naome-core/src/task_ledger/read.rs +118 -0
- package/crates/naome-core/src/task_ledger/render.rs +55 -0
- package/crates/naome-core/src/task_ledger/write.rs +38 -0
- package/crates/naome-core/src/task_ledger.rs +48 -0
- package/crates/naome-core/src/task_state/api.rs +4 -2
- package/crates/naome-core/src/task_state/completed_refresh.rs +5 -16
- package/crates/naome-core/src/task_state/diff.rs +2 -2
- package/crates/naome-core/src/task_state/evidence.rs +8 -3
- package/crates/naome-core/src/task_state/mod.rs +1 -1
- package/crates/naome-core/src/task_state/progress.rs +13 -0
- package/crates/naome-core/src/task_state/proof_model.rs +8 -8
- package/crates/naome-core/src/task_state/repair.rs +2 -2
- package/crates/naome-core/src/task_state/task_diff_api.rs +9 -18
- package/crates/naome-core/src/task_state/types.rs +24 -0
- package/crates/naome-core/src/verification.rs +29 -18
- package/crates/naome-core/src/workflow/agent/capability.rs +194 -0
- package/crates/naome-core/src/workflow/agent/context_delta.rs +42 -0
- package/crates/naome-core/src/workflow/agent/decision.rs +32 -0
- package/crates/naome-core/src/workflow/agent/execution.rs +80 -0
- package/crates/naome-core/src/workflow/agent/proof.rs +24 -0
- package/crates/naome-core/src/workflow/agent/support.rs +58 -0
- package/crates/naome-core/src/workflow/agent/watchdog.rs +47 -0
- package/crates/naome-core/src/workflow/agent.rs +34 -0
- package/crates/naome-core/src/workflow/agent_types.rs +105 -0
- package/crates/naome-core/src/workflow/doctor.rs +39 -0
- package/crates/naome-core/src/workflow/mod.rs +11 -0
- package/crates/naome-core/src/workflow/output.rs +8 -2
- package/crates/naome-core/src/workflow/phase_inference.rs +1 -1
- package/crates/naome-core/tests/context.rs +99 -0
- package/crates/naome-core/tests/harness_health.rs +4 -0
- package/crates/naome-core/tests/install_plan.rs +12 -0
- package/crates/naome-core/tests/quality.rs +178 -2
- package/crates/naome-core/tests/quality_performance.rs +39 -2
- package/crates/naome-core/tests/quality_structure_adapters.rs +39 -0
- package/crates/naome-core/tests/repo_support/mod.rs +5 -1
- package/crates/naome-core/tests/repo_support/verification_values.rs +55 -0
- package/crates/naome-core/tests/repository_model.rs +281 -0
- package/crates/naome-core/tests/route_user_diff.rs +49 -1
- package/crates/naome-core/tests/semantic_legacy.rs +72 -38
- package/crates/naome-core/tests/task_ledger.rs +328 -0
- package/crates/naome-core/tests/task_state.rs +28 -0
- package/crates/naome-core/tests/verification.rs +29 -36
- package/crates/naome-core/tests/workflow_agent.rs +233 -0
- package/crates/naome-core/tests/workflow_agent_support/mod.rs +159 -0
- package/crates/naome-core/tests/workflow_doctor.rs +21 -0
- package/installer/codex-hooks.js +121 -0
- package/installer/context.js +10 -0
- package/installer/filesystem.js +4 -0
- package/installer/flows.js +8 -4
- package/installer/harness-files.js +6 -0
- package/installer/install-plan.js +4 -0
- package/installer/main.js +1 -1
- package/installer/native.js +1 -1
- package/native/darwin-arm64/naome +0 -0
- package/native/linux-x64/naome +0 -0
- package/package.json +1 -1
- package/templates/naome-root/.codex/config.toml +2 -0
- package/templates/naome-root/.codex/hooks.json +70 -0
- package/templates/naome-root/.naome/bin/check-harness-health.js +8 -6
- package/templates/naome-root/.naome/bin/check-task-state.js +12 -7
- package/templates/naome-root/.naome/bin/codex-hook-io.js +122 -0
- package/templates/naome-root/.naome/bin/codex-hook-policy.js +180 -0
- package/templates/naome-root/.naome/bin/codex-hook-runtime.js +174 -0
- package/templates/naome-root/.naome/bin/codex-hook.js +6 -0
- package/templates/naome-root/.naome/bin/naome.js +35 -4
- package/templates/naome-root/.naome/manifest.json +12 -6
- package/templates/naome-root/.naome/repository-model.json +6 -0
- package/templates/naome-root/.naome/repository-quality.json +3 -1
- package/templates/naome-root/.naome/verification.json +15 -1
- package/templates/naome-root/AGENTS.md +38 -83
- package/templates/naome-root/docs/naome/agent-workflow.md +54 -18
- package/templates/naome-root/docs/naome/codex-hooks.md +82 -0
- package/templates/naome-root/docs/naome/context-economy.md +73 -0
- package/templates/naome-root/docs/naome/first-run.md +25 -14
- package/templates/naome-root/docs/naome/index.md +18 -10
- package/templates/naome-root/docs/naome/repository-model.md +92 -0
- package/templates/naome-root/docs/naome/repository-quality.md +47 -7
- package/templates/naome-root/docs/naome/repository-structure.md +10 -3
- package/templates/naome-root/docs/naome/task-ledger.md +71 -0
- package/templates/naome-root/docs/naome/testing.md +16 -3
|
@@ -6,7 +6,17 @@ NAOME keeps legacy debt visible without blocking unrelated feature work.
|
|
|
6
6
|
|
|
7
7
|
- `naome quality check --changed` blocks only on files changed in the current
|
|
8
8
|
diff. If a legacy file is touched, that file must satisfy the configured
|
|
9
|
-
quality rules before commit.
|
|
9
|
+
quality and semantic changed rules before commit.
|
|
10
|
+
- `naome quality check --path <path>` is the early touched-file gate. Run it
|
|
11
|
+
immediately after editing a file to catch file length, diff growth, function
|
|
12
|
+
length, top-level symbol count, same-file duplicate regions, structure
|
|
13
|
+
issues, and stale adapter/model policy before a large task accumulates.
|
|
14
|
+
Repeat `--path` for a small touched set. This is a fast local feedback gate;
|
|
15
|
+
the final `--changed` gate still remains required.
|
|
16
|
+
- `naome semantic check --changed` is also exposed as the explicit semantic
|
|
17
|
+
changed gate. Fresh verification profiles require it next to
|
|
18
|
+
`repository-quality-check`; `quality check --changed` includes the same
|
|
19
|
+
semantic changed findings for backward compatibility with older profiles.
|
|
10
20
|
- `naome quality report` scans the repository with normal budgets and reports
|
|
11
21
|
debt without failing feature work. Full repository duplicate,
|
|
12
22
|
near-duplicate, and semantic grouping checks are deep-only.
|
|
@@ -33,12 +43,41 @@ Adapters are plug-and-play profiles such as `rust` or
|
|
|
33
43
|
path rules at runtime without hard-coding a specific product repository into
|
|
34
44
|
the generic template.
|
|
35
45
|
|
|
46
|
+
Repository stacks can change after setup. `quality check --changed` and
|
|
47
|
+
`quality report` compare current repository signals with committed
|
|
48
|
+
`enabledAdapters`; when a new stack is present but not enabled, they emit
|
|
49
|
+
`adapter-policy-stale`. Use `naome quality reconcile --json` to inspect the
|
|
50
|
+
delta and `naome quality reconcile --write` to update
|
|
51
|
+
`.naome/repository-quality.json` and `.naome/repository-structure.json`
|
|
52
|
+
deterministically. Do not hand-edit adapter lists as the normal path.
|
|
53
|
+
|
|
54
|
+
Built-in adapter detection is path/manifest based and deterministic:
|
|
55
|
+
|
|
56
|
+
- `rust`: `Cargo.toml` or `.rs` files.
|
|
57
|
+
- `javascript-typescript`: `package.json` or JS/TS files.
|
|
58
|
+
- `swift`: `Package.swift` or `.swift` files.
|
|
59
|
+
- `xcode`: `.xcodeproj` or `.xcworkspace` content.
|
|
60
|
+
- `xctest`: Swift test targets such as `Tests`, `*Tests`, or `*UITests`.
|
|
61
|
+
- `swiftui`: SwiftUI-style app/view paths such as `*App.swift`,
|
|
62
|
+
`*View.swift`, `Views`, or Preview Content.
|
|
63
|
+
- `ios-app-structure`: iOS app entrypoints, `Info.plist`, entitlements, or
|
|
64
|
+
asset catalogs.
|
|
65
|
+
- `swift-package`: Swift Package Manager `Sources` and `Tests` layout.
|
|
66
|
+
- `ios-resources`: `.xcassets`, `.strings`, `.plist`, `.storyboard`, `.xib`,
|
|
67
|
+
and entitlements.
|
|
68
|
+
- `generated-ios`: SwiftGen, Sourcery, protobuf, and `*.generated.swift`
|
|
69
|
+
outputs.
|
|
70
|
+
|
|
36
71
|
Local `pathRules` are project overrides, not product defaults. They may document
|
|
37
72
|
repo-specific debt or special file roles, but loosening a rule to pass a feature
|
|
38
73
|
diff requires human review.
|
|
39
74
|
|
|
40
75
|
The scanner has three modes:
|
|
41
76
|
|
|
77
|
+
- `PathScoped`: explicitly requested touched files are read fully, with the
|
|
78
|
+
repository path index used for path/structure context. It avoids fully
|
|
79
|
+
analyzing unrelated changed files, making it suitable directly after file
|
|
80
|
+
writes.
|
|
42
81
|
- `ChangedFast`: changed files are read fully; unchanged files may contribute
|
|
43
82
|
cached facts for duplicate comparison.
|
|
44
83
|
- `Report`: repository-wide, budgeted debt visibility. If budgets are hit, JSON
|
|
@@ -64,29 +103,30 @@ path roles, module/layer policy, adapters, and cleanup routing.
|
|
|
64
103
|
Agents may propose stricter repo-specific rules after inspecting the language
|
|
65
104
|
and stack.
|
|
66
105
|
|
|
67
|
-
##
|
|
106
|
+
## Semantic Cleanup
|
|
68
107
|
|
|
69
108
|
Some maintainability debt is semantic rather than purely syntactic. Examples
|
|
70
109
|
include inline legacy compatibility fixtures, copied config objects, stale test
|
|
71
110
|
builders, hand-written schema snapshots, and helper data that should move into a
|
|
72
111
|
shared factory after enough call sites accumulate.
|
|
73
112
|
|
|
74
|
-
NAOME
|
|
75
|
-
|
|
76
|
-
|
|
113
|
+
NAOME detects these with a generic semantic-cleanup layer instead of hard-coding
|
|
114
|
+
product paths or deleting compatibility fixtures opportunistically. The model
|
|
115
|
+
is:
|
|
77
116
|
|
|
78
117
|
- detect repeated object shapes, schema literals, fixture builders, and config
|
|
79
118
|
snapshots across changed and report-mode files;
|
|
80
119
|
- classify each finding as `legacy fixture`, `duplicated fixture`,
|
|
81
120
|
`schema snapshot`, `generated metadata`, or `inline builder`;
|
|
82
121
|
- keep existing report-mode debt visible without blocking unrelated work;
|
|
83
|
-
- block
|
|
122
|
+
- block changed/new semantic debt through `quality check --changed` and
|
|
123
|
+
`semantic check --changed`;
|
|
84
124
|
- route cleanup to extract a shared fixture, builder, schema writer, or generated
|
|
85
125
|
metadata refresh command;
|
|
86
126
|
- preserve behavior by requiring tests before removing or consolidating legacy
|
|
87
127
|
compatibility fixtures.
|
|
88
128
|
|
|
89
|
-
|
|
129
|
+
Semantic cleanup is a scout and gate, not an auto-fixer:
|
|
90
130
|
|
|
91
131
|
- `naome semantic report --json` runs a budgeted semantic report.
|
|
92
132
|
- `naome semantic report --deep --json` runs repo-wide semantic grouping.
|
|
@@ -36,9 +36,16 @@ module location is more appropriate.
|
|
|
36
36
|
## Adapters
|
|
37
37
|
|
|
38
38
|
The core is language-independent. Adapters add deterministic signals for stack
|
|
39
|
-
conventions. Built-in adapters currently include `rust
|
|
40
|
-
`javascript-typescript
|
|
41
|
-
|
|
39
|
+
conventions. Built-in adapters currently include `rust`,
|
|
40
|
+
`javascript-typescript`, `swift`, `xcode`, `xctest`, `swiftui`,
|
|
41
|
+
`ios-app-structure`, `swift-package`, `ios-resources`, and `generated-ios`.
|
|
42
|
+
Future adapters can add source roots, test roots, module roots, and allowed
|
|
43
|
+
root files without changing gate behavior.
|
|
44
|
+
|
|
45
|
+
If the repository later adds a new stack, `quality check --changed` and
|
|
46
|
+
`quality report` emit `adapter-policy-stale` until
|
|
47
|
+
`naome quality reconcile --write` updates the committed quality and structure
|
|
48
|
+
policy files.
|
|
42
49
|
|
|
43
50
|
## Local Policy
|
|
44
51
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Task Ledger
|
|
2
|
+
|
|
3
|
+
NAOME task state is moving from one mutable aggregate file to a canonical task
|
|
4
|
+
ledger. The compatibility file `.naome/task-state.json` remains supported, but
|
|
5
|
+
new deterministic task tooling can use `.naome/tasks/` as the source of truth.
|
|
6
|
+
|
|
7
|
+
## Layout
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
.naome/tasks/
|
|
11
|
+
active.json
|
|
12
|
+
<task-id>/
|
|
13
|
+
task.json
|
|
14
|
+
events.jsonl
|
|
15
|
+
mutations.json
|
|
16
|
+
proofs/
|
|
17
|
+
<check-id>.json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- `active.json` identifies the primary task and leaves room for future
|
|
21
|
+
worklanes.
|
|
22
|
+
- `task.json` contains the stable task contract: request, prompt, admission,
|
|
23
|
+
allowed paths, change types, required checks, and human-review policy.
|
|
24
|
+
- `events.jsonl` is append-only. Status changes, blockers, and later decisions
|
|
25
|
+
are added as events instead of rewriting the whole task.
|
|
26
|
+
- `mutations.json` records touched paths and mutation ownership.
|
|
27
|
+
- `proofs/<check-id>.json` stores one verification result per check so parallel
|
|
28
|
+
checks do not rewrite the same file.
|
|
29
|
+
|
|
30
|
+
## Compatibility
|
|
31
|
+
|
|
32
|
+
Existing `naome.task-state.v1` and `naome.task-state.v2` files remain valid. If
|
|
33
|
+
`.naome/tasks/active.json` exists, NAOME readers build a canonical task model
|
|
34
|
+
from the ledger and render a `naome.task-state.v2` projection. If no ledger is
|
|
35
|
+
present, readers fall back to `.naome/task-state.json`.
|
|
36
|
+
|
|
37
|
+
Use this command when an external tool needs the compatibility file refreshed:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
node .naome/bin/naome.js task render-state --write --json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`naome sync` automatically splits an active legacy `task-state` file into the
|
|
44
|
+
ledger layout. The explicit command remains available for repair or tests:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
node .naome/bin/naome.js task migrate-ledger --write --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
After `.naome/tasks/active.json` exists, `.naome/task-state.json` is a rendered
|
|
51
|
+
compatibility projection. NAOME gates reject a stale projection and report the
|
|
52
|
+
render command instead of accepting hand-edited aggregate state.
|
|
53
|
+
|
|
54
|
+
## Conflict Policy
|
|
55
|
+
|
|
56
|
+
`.naome/tasks/` is NAOME control state. It is not task feature scope and is not
|
|
57
|
+
required as proof evidence. Gates ignore ledger control files when checking
|
|
58
|
+
whether product changes stay inside `allowedPaths`.
|
|
59
|
+
|
|
60
|
+
The intended long-term model is:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
task spec + events + mutations + proofs + verification config
|
|
64
|
+
=> canonical task model
|
|
65
|
+
=> generated task-state projection
|
|
66
|
+
=> gates / route / commit / completion
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This keeps old repositories backward-compatible while making future parallel
|
|
70
|
+
agents safer: separate agents and checks can write separate event/proof files
|
|
71
|
+
instead of all competing for `.naome/task-state.json`.
|
|
@@ -9,6 +9,18 @@ Status: Uninitialized
|
|
|
9
9
|
| NAOME baseline | Built-in harness proof | See Known Checks | Seeded by installer; extend during first-run intake. |
|
|
10
10
|
| Repository-specific work | Unknown | Unknown | Fill during first-run intake. |
|
|
11
11
|
|
|
12
|
+
## Early Feedback
|
|
13
|
+
|
|
14
|
+
After writing or heavily editing a file, run
|
|
15
|
+
`node .naome/bin/naome.js quality check --path <path>` for immediate
|
|
16
|
+
touched-file feedback. This catches local size, symbol, duplicate, structure,
|
|
17
|
+
and stale-policy issues before the task grows. It does not replace the final
|
|
18
|
+
`repository-quality-check`; always run the changed-file gate before completion.
|
|
19
|
+
|
|
20
|
+
Optional Codex hooks can provide the same kind of early feedback during an
|
|
21
|
+
agent run. They are acceleration only; final proof still comes from the
|
|
22
|
+
commands in this document and `.naome/verification.json`.
|
|
23
|
+
|
|
12
24
|
## Known Checks
|
|
13
25
|
|
|
14
26
|
| Check id | Command | Cwd | Cost | Last verified |
|
|
@@ -17,6 +29,7 @@ Status: Uninitialized
|
|
|
17
29
|
| naome-harness-health | `node .naome/bin/check-harness-health.js` | `.` | fast | null |
|
|
18
30
|
| naome-task-state | `node .naome/bin/check-task-state.js` | `.` | fast | null |
|
|
19
31
|
| repository-quality-check | `node .naome/bin/naome.js quality check --changed` | `.` | fast | null |
|
|
32
|
+
| repository-semantic-check | `node .naome/bin/naome.js semantic check --changed` | `.` | fast | null |
|
|
20
33
|
|
|
21
34
|
## Verification Phases
|
|
22
35
|
|
|
@@ -57,8 +70,8 @@ phase is failing or missing.
|
|
|
57
70
|
and 10 release gates.
|
|
58
71
|
- Store long command output as a compact summary that preserves command, cwd,
|
|
59
72
|
exit code, relevant lines, affected paths, and artifacts.
|
|
60
|
-
- When intake defines change types, include `repository-quality-check`
|
|
61
|
-
required
|
|
62
|
-
CI changes.
|
|
73
|
+
- When intake defines change types, include `repository-quality-check` and
|
|
74
|
+
`repository-semantic-check` as required checks for source, structure,
|
|
75
|
+
documentation, harness, template, and CI changes.
|
|
63
76
|
- Before completion, select proof from the Verification Map when possible.
|
|
64
77
|
- Report exact commands and results. Do not claim proof that did not run.
|