@lamentis/naome 1.2.1 → 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 +117 -47
- package/bin/naome.js +65 -12
- 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 +12 -2
- package/crates/naome-cli/src/main.rs +78 -29
- package/crates/naome-cli/src/quality_commands.rs +238 -34
- 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 +120 -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/git.rs +4 -2
- package/crates/naome-core/src/install_plan.rs +20 -0
- package/crates/naome-core/src/journal.rs +2 -7
- package/crates/naome-core/src/lib.rs +35 -8
- 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/baseline.rs +8 -0
- package/crates/naome-core/src/quality/cache.rs +151 -0
- package/crates/naome-core/src/quality/checks/duplicate_blocks.rs +19 -8
- package/crates/naome-core/src/quality/checks/near_duplicates.rs +4 -2
- package/crates/naome-core/src/quality/checks.rs +7 -8
- package/crates/naome-core/src/quality/cleanup.rs +36 -3
- package/crates/naome-core/src/quality/config.rs +21 -3
- package/crates/naome-core/src/quality/mod.rs +189 -10
- 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/normalize.rs +78 -0
- package/crates/naome-core/src/quality/scanner/analysis.rs +175 -0
- package/crates/naome-core/src/quality/scanner/repo_paths.rs +39 -3
- package/crates/naome-core/src/quality/scanner.rs +235 -217
- package/crates/naome-core/src/quality/semantic/checks.rs +151 -0
- package/crates/naome-core/src/quality/semantic/extract.rs +158 -0
- package/crates/naome-core/src/quality/semantic/model.rs +85 -0
- package/crates/naome-core/src/quality/semantic/route.rs +52 -0
- package/crates/naome-core/src/quality/semantic.rs +68 -0
- 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 +13 -21
- package/crates/naome-core/src/quality/structure/checks.rs +1 -1
- package/crates/naome-core/src/quality/structure/classify/roles.rs +51 -5
- package/crates/naome-core/src/quality/structure/classify.rs +52 -0
- package/crates/naome-core/src/quality/structure/config.rs +24 -3
- package/crates/naome-core/src/quality/structure/mod.rs +5 -2
- package/crates/naome-core/src/quality/structure/model.rs +8 -1
- package/crates/naome-core/src/quality/types.rs +59 -2
- 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 +41 -16
- 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 +183 -0
- package/crates/naome-core/src/workflow/mod.rs +13 -0
- package/crates/naome-core/src/workflow/mutation.rs +1 -2
- 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 +14 -0
- package/crates/naome-core/tests/quality.rs +190 -5
- package/crates/naome-core/tests/quality_performance.rs +268 -0
- package/crates/naome-core/tests/quality_structure_adapters.rs +39 -0
- package/crates/naome-core/tests/quality_structure_policy.rs +19 -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 +59 -7
- package/crates/naome-core/tests/semantic_legacy.rs +174 -0
- 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 +45 -0
- package/crates/naome-core/tests/workflow_policy.rs +6 -1
- 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/git-boundary.js +1 -0
- 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 +45 -7
- 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/.naomeignore +1 -0
- package/templates/naome-root/AGENTS.md +38 -83
- package/templates/naome-root/docs/naome/agent-workflow.md +66 -28
- 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 +104 -5
- 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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Repository World Model
|
|
2
|
+
|
|
3
|
+
The repository model is the deterministic source for machine-readable facts
|
|
4
|
+
about this repository. It keeps stack and layout facts out of free-form
|
|
5
|
+
Markdown so agents can make repeatable decisions.
|
|
6
|
+
|
|
7
|
+
## Files
|
|
8
|
+
|
|
9
|
+
- `.naome/repository-model.json` stores canonical facts.
|
|
10
|
+
- `.naome/verification.json` stores runnable checks and change-type proof
|
|
11
|
+
policy.
|
|
12
|
+
- Repository-quality and repository-structure policy store quality adapters and
|
|
13
|
+
layout rules.
|
|
14
|
+
- Markdown documents explain workflow and summarize human context; they are not
|
|
15
|
+
the primary store for build, stack, or path-role facts.
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
- `naome repo model --write --json` refreshes the model from repository files.
|
|
20
|
+
- `naome repo check --json` verifies the committed model is current.
|
|
21
|
+
- `naome repo explain --path <path> --json` explains the role and language for a
|
|
22
|
+
path using the canonical model.
|
|
23
|
+
|
|
24
|
+
## Facts
|
|
25
|
+
|
|
26
|
+
`naome.repository-model.v2` keeps the backward-compatible flat `facts[]` list
|
|
27
|
+
and adds typed world-model sections. `naome.repository-model.v1` remains
|
|
28
|
+
readable; new writes prefer v2.
|
|
29
|
+
|
|
30
|
+
Flat facts are deterministic records with stable ids:
|
|
31
|
+
|
|
32
|
+
- `language:<value>`
|
|
33
|
+
- `packageManager:<value>`
|
|
34
|
+
- `buildSystem:<value>`
|
|
35
|
+
- `sourceRoot:<path>`
|
|
36
|
+
- `testRoot:<path>`
|
|
37
|
+
- `docsRoot:<path>`
|
|
38
|
+
- `generatedRoot:<path>`
|
|
39
|
+
- `artifactRoot:<path>`
|
|
40
|
+
- `verificationCheck:<id>`
|
|
41
|
+
|
|
42
|
+
Each fact includes evidence paths and a source. Do not hand-edit generated facts
|
|
43
|
+
as normal workflow. Refresh them with the command above.
|
|
44
|
+
|
|
45
|
+
## World Sections
|
|
46
|
+
|
|
47
|
+
The v2 model stores typed sections so agents do not need to infer repository
|
|
48
|
+
shape from prose:
|
|
49
|
+
|
|
50
|
+
- `languages`, `packageManagers`, and `buildSystems`
|
|
51
|
+
- `adapters` detected from deterministic stack signals
|
|
52
|
+
- `roots` for source, test, docs, generated, and artifact paths
|
|
53
|
+
- `entities` for packages, apps, and modules
|
|
54
|
+
- `pathFacts` for significant paths with role, module, entity, language, and
|
|
55
|
+
generated/artifact flags
|
|
56
|
+
- `verificationChecks` copied from `.naome/verification.json`
|
|
57
|
+
|
|
58
|
+
These sections are generic and adapter-extensible. Product defaults must not
|
|
59
|
+
contain repository-specific exceptions.
|
|
60
|
+
|
|
61
|
+
## Agent Rule
|
|
62
|
+
|
|
63
|
+
When a task depends on the stack, package manager, build system, source roots,
|
|
64
|
+
test roots, generated roots, or verification ids, read or refresh the repository
|
|
65
|
+
model instead of searching broad Markdown files. If the model is stale, update it
|
|
66
|
+
first, then continue with the task.
|
|
67
|
+
|
|
68
|
+
For a specific path, use:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
naome repo explain --path <path> --json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The explanation returns the canonical role, language, module, entity, matching
|
|
75
|
+
facts, and evidence for that path.
|
|
76
|
+
|
|
77
|
+
## Drift Gates
|
|
78
|
+
|
|
79
|
+
NAOME does not silently rewrite `.naome/repository-model.json` during normal
|
|
80
|
+
gates. Instead, stale facts are reported deterministically:
|
|
81
|
+
|
|
82
|
+
- `naome doctor --json` reports a stale repository model section.
|
|
83
|
+
- `node .naome/bin/check-task-state.js --progress` blocks active work until the
|
|
84
|
+
model is refreshed.
|
|
85
|
+
- `naome quality check --changed --json` emits `repository-model-stale` as a
|
|
86
|
+
changed-code finding.
|
|
87
|
+
|
|
88
|
+
The fix is explicit and idempotent:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
naome repo model --write --json
|
|
92
|
+
```
|
|
@@ -6,26 +6,90 @@ 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.
|
|
10
|
-
- `naome quality
|
|
11
|
-
|
|
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.
|
|
20
|
+
- `naome quality report` scans the repository with normal budgets and reports
|
|
21
|
+
debt without failing feature work. Full repository duplicate,
|
|
22
|
+
near-duplicate, and semantic grouping checks are deep-only.
|
|
23
|
+
- `naome quality report --deep` runs the intentionally expensive full
|
|
24
|
+
repository checks.
|
|
12
25
|
- `naome cleanup plan` groups report findings into deterministic cleanup tasks.
|
|
13
26
|
- `naome cleanup route --path <path>` returns agent instructions for one file.
|
|
27
|
+
Structure findings include rule-specific guidance such as moving misplaced
|
|
28
|
+
tests, pairing source with nearby tests, splitting dumping-ground folders, or
|
|
29
|
+
resolving case collisions.
|
|
14
30
|
|
|
15
31
|
## Configuration
|
|
16
32
|
|
|
17
33
|
Repository-specific rules live in `.naome/repository-quality.json`.
|
|
18
34
|
|
|
35
|
+
`quality init` writes only policy files and an empty baseline placeholder. It
|
|
36
|
+
does not deep-scan the repository. To record existing debt intentionally, run
|
|
37
|
+
`quality init --baseline`; use `quality init --deep-baseline` only when broad
|
|
38
|
+
duplicate and semantic grouping checks are expected.
|
|
39
|
+
|
|
19
40
|
`quality init` selects deterministic built-in adapters from repository files.
|
|
20
41
|
Adapters are plug-and-play profiles such as `rust` or
|
|
21
42
|
`javascript-typescript`. They add stack-specific ignored/generated paths and
|
|
22
43
|
path rules at runtime without hard-coding a specific product repository into
|
|
23
44
|
the generic template.
|
|
24
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
|
+
|
|
25
71
|
Local `pathRules` are project overrides, not product defaults. They may document
|
|
26
72
|
repo-specific debt or special file roles, but loosening a rule to pass a feature
|
|
27
73
|
diff requires human review.
|
|
28
74
|
|
|
75
|
+
The scanner has three modes:
|
|
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.
|
|
81
|
+
- `ChangedFast`: changed files are read fully; unchanged files may contribute
|
|
82
|
+
cached facts for duplicate comparison.
|
|
83
|
+
- `Report`: repository-wide, budgeted debt visibility. If budgets are hit, JSON
|
|
84
|
+
sets `summary.truncated` and includes stable `reasonCodes`.
|
|
85
|
+
- `DeepReport`: explicit expensive scan for full duplicate, near-duplicate, and
|
|
86
|
+
semantic grouping work.
|
|
87
|
+
|
|
88
|
+
Per-file analysis facts are cached under `.naome/cache/quality/`. Cache entries
|
|
89
|
+
are local-only, keyed by NAOME version, config hash, adapter version, path, and
|
|
90
|
+
content hash. Cache corruption or misses cause a rescan, not a gate failure.
|
|
91
|
+
Use `quality cache status --json` and `quality cache clear` for maintenance.
|
|
92
|
+
|
|
29
93
|
The default scanner is language-agnostic and uses text plus symbol heuristics:
|
|
30
94
|
file length, diff growth, function or component length, top-level symbol count,
|
|
31
95
|
duplicate regions, and near-duplicate functions. Duplicate regions are grouped
|
|
@@ -39,8 +103,43 @@ path roles, module/layer policy, adapters, and cleanup routing.
|
|
|
39
103
|
Agents may propose stricter repo-specific rules after inspecting the language
|
|
40
104
|
and stack.
|
|
41
105
|
|
|
106
|
+
## Semantic Cleanup
|
|
107
|
+
|
|
108
|
+
Some maintainability debt is semantic rather than purely syntactic. Examples
|
|
109
|
+
include inline legacy compatibility fixtures, copied config objects, stale test
|
|
110
|
+
builders, hand-written schema snapshots, and helper data that should move into a
|
|
111
|
+
shared factory after enough call sites accumulate.
|
|
112
|
+
|
|
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:
|
|
116
|
+
|
|
117
|
+
- detect repeated object shapes, schema literals, fixture builders, and config
|
|
118
|
+
snapshots across changed and report-mode files;
|
|
119
|
+
- classify each finding as `legacy fixture`, `duplicated fixture`,
|
|
120
|
+
`schema snapshot`, `generated metadata`, or `inline builder`;
|
|
121
|
+
- keep existing report-mode debt visible without blocking unrelated work;
|
|
122
|
+
- block changed/new semantic debt through `quality check --changed` and
|
|
123
|
+
`semantic check --changed`;
|
|
124
|
+
- route cleanup to extract a shared fixture, builder, schema writer, or generated
|
|
125
|
+
metadata refresh command;
|
|
126
|
+
- preserve behavior by requiring tests before removing or consolidating legacy
|
|
127
|
+
compatibility fixtures.
|
|
128
|
+
|
|
129
|
+
Semantic cleanup is a scout and gate, not an auto-fixer:
|
|
130
|
+
|
|
131
|
+
- `naome semantic report --json` runs a budgeted semantic report.
|
|
132
|
+
- `naome semantic report --deep --json` runs repo-wide semantic grouping.
|
|
133
|
+
- `naome semantic check --changed --json` checks only changed semantic debt for
|
|
134
|
+
gate use.
|
|
135
|
+
- `naome semantic route --finding <id> --json` gives an agent the complete
|
|
136
|
+
affected path list, cleanup intent, and required checks for one finding group.
|
|
137
|
+
- `naome semantic loop --json` selects the next deterministic cleanup action:
|
|
138
|
+
changed-code findings first, then report-only legacy debt.
|
|
139
|
+
|
|
42
140
|
## Baseline
|
|
43
141
|
|
|
44
142
|
Existing debt is recorded in `.naome/repository-quality-baseline.json` by
|
|
45
|
-
`naome quality init
|
|
46
|
-
files are blocking
|
|
143
|
+
`naome quality init --baseline` or `naome quality init --deep-baseline`.
|
|
144
|
+
Baseline debt remains visible in reports, but only changed files are blocking
|
|
145
|
+
during feature work.
|
|
@@ -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.
|