@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.
Files changed (155) hide show
  1. package/Cargo.lock +2 -2
  2. package/README.md +117 -47
  3. package/bin/naome.js +65 -12
  4. package/crates/naome-cli/Cargo.toml +1 -1
  5. package/crates/naome-cli/src/context_commands.rs +47 -0
  6. package/crates/naome-cli/src/dispatcher.rs +12 -2
  7. package/crates/naome-cli/src/main.rs +78 -29
  8. package/crates/naome-cli/src/quality_commands.rs +238 -34
  9. package/crates/naome-cli/src/quality_output.rs +34 -0
  10. package/crates/naome-cli/src/quality_reconcile_command.rs +45 -0
  11. package/crates/naome-cli/src/repository_model_commands.rs +84 -0
  12. package/crates/naome-cli/src/task_commands.rs +62 -0
  13. package/crates/naome-cli/src/workflow_commands.rs +120 -3
  14. package/crates/naome-core/Cargo.toml +1 -1
  15. package/crates/naome-core/src/context/helpers.rs +75 -0
  16. package/crates/naome-core/src/context/select.rs +134 -0
  17. package/crates/naome-core/src/context/types.rs +43 -0
  18. package/crates/naome-core/src/context.rs +6 -0
  19. package/crates/naome-core/src/decision/states.rs +1 -1
  20. package/crates/naome-core/src/decision.rs +4 -1
  21. package/crates/naome-core/src/git.rs +4 -2
  22. package/crates/naome-core/src/install_plan.rs +20 -0
  23. package/crates/naome-core/src/journal.rs +2 -7
  24. package/crates/naome-core/src/lib.rs +35 -8
  25. package/crates/naome-core/src/quality/adapter_ios.rs +131 -0
  26. package/crates/naome-core/src/quality/adapter_support.rs +67 -0
  27. package/crates/naome-core/src/quality/adapters.rs +81 -18
  28. package/crates/naome-core/src/quality/baseline.rs +8 -0
  29. package/crates/naome-core/src/quality/cache.rs +151 -0
  30. package/crates/naome-core/src/quality/checks/duplicate_blocks.rs +19 -8
  31. package/crates/naome-core/src/quality/checks/near_duplicates.rs +4 -2
  32. package/crates/naome-core/src/quality/checks.rs +7 -8
  33. package/crates/naome-core/src/quality/cleanup.rs +36 -3
  34. package/crates/naome-core/src/quality/config.rs +21 -3
  35. package/crates/naome-core/src/quality/mod.rs +189 -10
  36. package/crates/naome-core/src/quality/reconcile.rs +138 -0
  37. package/crates/naome-core/src/quality/reconcile_anchors.rs +64 -0
  38. package/crates/naome-core/src/quality/scanner/analysis/normalize.rs +78 -0
  39. package/crates/naome-core/src/quality/scanner/analysis.rs +175 -0
  40. package/crates/naome-core/src/quality/scanner/repo_paths.rs +39 -3
  41. package/crates/naome-core/src/quality/scanner.rs +235 -217
  42. package/crates/naome-core/src/quality/semantic/checks.rs +151 -0
  43. package/crates/naome-core/src/quality/semantic/extract.rs +158 -0
  44. package/crates/naome-core/src/quality/semantic/model.rs +85 -0
  45. package/crates/naome-core/src/quality/semantic/route.rs +52 -0
  46. package/crates/naome-core/src/quality/semantic.rs +68 -0
  47. package/crates/naome-core/src/quality/structure/adapter_ios.rs +149 -0
  48. package/crates/naome-core/src/quality/structure/adapters.rs +60 -42
  49. package/crates/naome-core/src/quality/structure/checks/directory.rs +13 -21
  50. package/crates/naome-core/src/quality/structure/checks.rs +1 -1
  51. package/crates/naome-core/src/quality/structure/classify/roles.rs +51 -5
  52. package/crates/naome-core/src/quality/structure/classify.rs +52 -0
  53. package/crates/naome-core/src/quality/structure/config.rs +24 -3
  54. package/crates/naome-core/src/quality/structure/mod.rs +5 -2
  55. package/crates/naome-core/src/quality/structure/model.rs +8 -1
  56. package/crates/naome-core/src/quality/types.rs +59 -2
  57. package/crates/naome-core/src/repository_model/detect.rs +188 -0
  58. package/crates/naome-core/src/repository_model/explain.rs +121 -0
  59. package/crates/naome-core/src/repository_model/path_scan.rs +67 -0
  60. package/crates/naome-core/src/repository_model/path_support.rs +59 -0
  61. package/crates/naome-core/src/repository_model/types.rs +152 -0
  62. package/crates/naome-core/src/repository_model/world.rs +48 -0
  63. package/crates/naome-core/src/repository_model/world_adapters.rs +145 -0
  64. package/crates/naome-core/src/repository_model/world_path_facts.rs +55 -0
  65. package/crates/naome-core/src/repository_model/world_paths.rs +168 -0
  66. package/crates/naome-core/src/repository_model.rs +164 -0
  67. package/crates/naome-core/src/route/builtin_checks.rs +41 -16
  68. package/crates/naome-core/src/task_ledger/import.rs +142 -0
  69. package/crates/naome-core/src/task_ledger/model.rs +13 -0
  70. package/crates/naome-core/src/task_ledger/proof_record.rs +52 -0
  71. package/crates/naome-core/src/task_ledger/read.rs +118 -0
  72. package/crates/naome-core/src/task_ledger/render.rs +55 -0
  73. package/crates/naome-core/src/task_ledger/write.rs +38 -0
  74. package/crates/naome-core/src/task_ledger.rs +48 -0
  75. package/crates/naome-core/src/task_state/api.rs +4 -2
  76. package/crates/naome-core/src/task_state/completed_refresh.rs +5 -16
  77. package/crates/naome-core/src/task_state/diff.rs +2 -2
  78. package/crates/naome-core/src/task_state/evidence.rs +8 -3
  79. package/crates/naome-core/src/task_state/mod.rs +1 -1
  80. package/crates/naome-core/src/task_state/progress.rs +13 -0
  81. package/crates/naome-core/src/task_state/proof_model.rs +8 -8
  82. package/crates/naome-core/src/task_state/repair.rs +2 -2
  83. package/crates/naome-core/src/task_state/task_diff_api.rs +9 -18
  84. package/crates/naome-core/src/task_state/types.rs +24 -0
  85. package/crates/naome-core/src/verification.rs +29 -18
  86. package/crates/naome-core/src/workflow/agent/capability.rs +194 -0
  87. package/crates/naome-core/src/workflow/agent/context_delta.rs +42 -0
  88. package/crates/naome-core/src/workflow/agent/decision.rs +32 -0
  89. package/crates/naome-core/src/workflow/agent/execution.rs +80 -0
  90. package/crates/naome-core/src/workflow/agent/proof.rs +24 -0
  91. package/crates/naome-core/src/workflow/agent/support.rs +58 -0
  92. package/crates/naome-core/src/workflow/agent/watchdog.rs +47 -0
  93. package/crates/naome-core/src/workflow/agent.rs +34 -0
  94. package/crates/naome-core/src/workflow/agent_types.rs +105 -0
  95. package/crates/naome-core/src/workflow/doctor.rs +183 -0
  96. package/crates/naome-core/src/workflow/mod.rs +13 -0
  97. package/crates/naome-core/src/workflow/mutation.rs +1 -2
  98. package/crates/naome-core/src/workflow/output.rs +8 -2
  99. package/crates/naome-core/src/workflow/phase_inference.rs +1 -1
  100. package/crates/naome-core/tests/context.rs +99 -0
  101. package/crates/naome-core/tests/harness_health.rs +4 -0
  102. package/crates/naome-core/tests/install_plan.rs +14 -0
  103. package/crates/naome-core/tests/quality.rs +190 -5
  104. package/crates/naome-core/tests/quality_performance.rs +268 -0
  105. package/crates/naome-core/tests/quality_structure_adapters.rs +39 -0
  106. package/crates/naome-core/tests/quality_structure_policy.rs +19 -0
  107. package/crates/naome-core/tests/repo_support/mod.rs +5 -1
  108. package/crates/naome-core/tests/repo_support/verification_values.rs +55 -0
  109. package/crates/naome-core/tests/repository_model.rs +281 -0
  110. package/crates/naome-core/tests/route_user_diff.rs +59 -7
  111. package/crates/naome-core/tests/semantic_legacy.rs +174 -0
  112. package/crates/naome-core/tests/task_ledger.rs +328 -0
  113. package/crates/naome-core/tests/task_state.rs +28 -0
  114. package/crates/naome-core/tests/verification.rs +29 -36
  115. package/crates/naome-core/tests/workflow_agent.rs +233 -0
  116. package/crates/naome-core/tests/workflow_agent_support/mod.rs +159 -0
  117. package/crates/naome-core/tests/workflow_doctor.rs +45 -0
  118. package/crates/naome-core/tests/workflow_policy.rs +6 -1
  119. package/installer/codex-hooks.js +121 -0
  120. package/installer/context.js +10 -0
  121. package/installer/filesystem.js +4 -0
  122. package/installer/flows.js +8 -4
  123. package/installer/git-boundary.js +1 -0
  124. package/installer/harness-files.js +6 -0
  125. package/installer/install-plan.js +4 -0
  126. package/installer/main.js +1 -1
  127. package/installer/native.js +1 -1
  128. package/native/darwin-arm64/naome +0 -0
  129. package/native/linux-x64/naome +0 -0
  130. package/package.json +1 -1
  131. package/templates/naome-root/.codex/config.toml +2 -0
  132. package/templates/naome-root/.codex/hooks.json +70 -0
  133. package/templates/naome-root/.naome/bin/check-harness-health.js +8 -6
  134. package/templates/naome-root/.naome/bin/check-task-state.js +12 -7
  135. package/templates/naome-root/.naome/bin/codex-hook-io.js +122 -0
  136. package/templates/naome-root/.naome/bin/codex-hook-policy.js +180 -0
  137. package/templates/naome-root/.naome/bin/codex-hook-runtime.js +174 -0
  138. package/templates/naome-root/.naome/bin/codex-hook.js +6 -0
  139. package/templates/naome-root/.naome/bin/naome.js +45 -7
  140. package/templates/naome-root/.naome/manifest.json +12 -6
  141. package/templates/naome-root/.naome/repository-model.json +6 -0
  142. package/templates/naome-root/.naome/repository-quality.json +3 -1
  143. package/templates/naome-root/.naome/verification.json +15 -1
  144. package/templates/naome-root/.naomeignore +1 -0
  145. package/templates/naome-root/AGENTS.md +38 -83
  146. package/templates/naome-root/docs/naome/agent-workflow.md +66 -28
  147. package/templates/naome-root/docs/naome/codex-hooks.md +82 -0
  148. package/templates/naome-root/docs/naome/context-economy.md +73 -0
  149. package/templates/naome-root/docs/naome/first-run.md +25 -14
  150. package/templates/naome-root/docs/naome/index.md +18 -10
  151. package/templates/naome-root/docs/naome/repository-model.md +92 -0
  152. package/templates/naome-root/docs/naome/repository-quality.md +104 -5
  153. package/templates/naome-root/docs/naome/repository-structure.md +10 -3
  154. package/templates/naome-root/docs/naome/task-ledger.md +71 -0
  155. 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 report` scans the repository and reports debt without failing
11
- normal feature work.
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`. Baseline debt remains visible in reports, but only changed
46
- files are blocking during feature work.
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` and
40
- `javascript-typescript`; future adapters can add source roots, test roots,
41
- module roots, and allowed root files without changing gate behavior.
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` as a
61
- required check for source, structure, documentation, harness, template, and
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.