@lamentis/naome 1.4.5 → 1.4.6
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/crates/naome-cli/Cargo.toml +1 -1
- package/crates/naome-cli/src/main.rs +1 -0
- package/crates/naome-cli/src/task_commands/common.rs +3 -3
- package/crates/naome-cli/tests/task_cli_local_state.rs +59 -0
- package/crates/naome-core/Cargo.toml +1 -1
- package/crates/naome-core/src/information_architecture.rs +1 -1
- package/crates/naome-core/src/install_plan.rs +2 -2
- package/crates/naome-core/src/route/execution_baselines.rs +3 -1
- package/crates/naome-core/src/route/git_ops.rs +48 -1
- package/crates/naome-core/src/route/worktree_files.rs +36 -1
- package/crates/naome-core/src/task_ledger.rs +13 -2
- package/crates/naome-core/src/task_state/commit_gate.rs +29 -0
- package/crates/naome-core/src/task_state/completed_refresh.rs +10 -2
- package/crates/naome-core/src/task_state/task_diff_api.rs +17 -3
- package/crates/naome-core/src/task_state/types.rs +1 -0
- package/crates/naome-core/tests/information_architecture.rs +1 -4
- package/crates/naome-core/tests/install_plan.rs +7 -0
- package/crates/naome-core/tests/repo_support/mod.rs +4 -3
- package/crates/naome-core/tests/route_baseline.rs +104 -0
- package/crates/naome-core/tests/route_worktree.rs +47 -1
- package/crates/naome-core/tests/task_ledger.rs +141 -203
- package/crates/naome-core/tests/task_ledger_support/mod.rs +206 -0
- package/crates/naome-core/tests/task_state.rs +38 -1
- package/crates/naome-core/tests/task_state_compact.rs +1 -1
- package/installer/harness-file-ops.js +6 -1
- package/installer/harness-files.js +10 -1
- 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 +4 -4
- package/templates/naome-root/.naome/bin/check-task-state.js +4 -4
- package/templates/naome-root/.naome/manifest.json +5 -6
- package/templates/naome-root/AGENTS.md +3 -1
- package/templates/naome-root/docs/naome/agent-workflow.md +4 -3
- package/templates/naome-root/docs/naome/architecture.md +2 -2
- package/templates/naome-root/docs/naome/execution.md +6 -6
- package/templates/naome-root/docs/naome/task-ledger.md +15 -11
|
@@ -48,7 +48,7 @@ fn compact_path_sets_and_batches_cover_completion_commit_and_route() {
|
|
|
48
48
|
"auto_commit_completed_task_then_create_new_task"
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
repo.git(["add", "README.md"
|
|
51
|
+
repo.git(["add", "README.md"]);
|
|
52
52
|
let commit_gate = repo.validate(TaskStateMode::CommitGate);
|
|
53
53
|
assert_eq!(commit_gate.errors, Vec::<String>::new());
|
|
54
54
|
}
|
|
@@ -13,7 +13,7 @@ import { archiveUpgradePath, assertWritableArchivePath, hasSymlinkInTargetPath }
|
|
|
13
13
|
import { machineFileHash } from "./native.js";
|
|
14
14
|
import { printError } from "./output.js";
|
|
15
15
|
|
|
16
|
-
export function ensureTemplateFile(ctx, relativePath) {
|
|
16
|
+
export function ensureTemplateFile(ctx, relativePath, options = {}) {
|
|
17
17
|
const sourcePath = join(ctx.templateRoot, relativePath);
|
|
18
18
|
const targetPath = join(ctx.targetRoot, relativePath);
|
|
19
19
|
|
|
@@ -33,6 +33,11 @@ export function ensureTemplateFile(ctx, relativePath) {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
if (options.skipWhenMissing?.()) {
|
|
37
|
+
ctx.skipped.push(relativePath);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
36
41
|
mkdirSync(dirname(targetPath), { recursive: true });
|
|
37
42
|
copyFileSync(sourcePath, targetPath);
|
|
38
43
|
ctx.installed.push(relativePath);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
1
4
|
import {
|
|
2
5
|
ensureNaomeIgnore,
|
|
3
6
|
ensureTemplateFile,
|
|
@@ -32,7 +35,9 @@ export function ensureRepositoryStructurePolicyFiles(ctx) {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
export function ensureTaskControlHarnessFiles(ctx, archiveDirName) {
|
|
35
|
-
ensureTemplateFile(ctx, ".naome/task-state.json"
|
|
38
|
+
ensureTemplateFile(ctx, ".naome/task-state.json", {
|
|
39
|
+
skipWhenMissing: () => activeTaskLedgerExists(ctx),
|
|
40
|
+
});
|
|
36
41
|
replaceHarnessFile(ctx, ".naome/task-contract.schema.json", archiveDirName);
|
|
37
42
|
replaceHarnessFile(ctx, ".naome/bin/check-task-state.js", archiveDirName);
|
|
38
43
|
replaceHarnessFile(ctx, "AGENTS.md", archiveDirName);
|
|
@@ -44,6 +49,10 @@ export function ensureTaskControlHarnessFiles(ctx, archiveDirName) {
|
|
|
44
49
|
replaceHarnessFile(ctx, "docs/naome/upgrade.md", archiveDirName);
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
function activeTaskLedgerExists(ctx) {
|
|
53
|
+
return existsSync(join(ctx.targetRoot, ".naome", "tasks", "active.json"));
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
export function ensureHarnessHealthFiles(ctx, archiveDirName) {
|
|
48
57
|
replaceHarnessFile(ctx, "AGENTS.md", archiveDirName);
|
|
49
58
|
replaceHarnessFile(ctx, ".naome/package.json", archiveDirName);
|
|
Binary file
|
package/native/linux-x64/naome
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -15,14 +15,14 @@ const expectedMachineOwnedIntegrity = Object.freeze({
|
|
|
15
15
|
".naome/bin/naome.js": "sha256:8a9d9ed783981ef9750021fa30e92460283775bb4a0eacdea60b63041a9c6a05",
|
|
16
16
|
".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
|
|
17
17
|
".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
|
|
18
|
-
"AGENTS.md": "sha256:
|
|
19
|
-
"docs/naome/agent-workflow.md": "sha256:
|
|
18
|
+
"AGENTS.md": "sha256:28b51a5df52c90f21b62ecc110937cb254dbedcc22a36596a873dc02adb20623",
|
|
19
|
+
"docs/naome/agent-workflow.md": "sha256:3812a065adfbcdcacae42c93e58eedb90fa9439cd4d8fe97583d6718da9cb8af",
|
|
20
20
|
"docs/naome/architecture-fitness.md": "sha256:be38e0c6dea8b1ebeee3bfd4a2e4e17008829360b1b4649ef45f2ce61e7287bd",
|
|
21
21
|
"docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
|
|
22
|
-
"docs/naome/execution.md": "sha256:
|
|
22
|
+
"docs/naome/execution.md": "sha256:3e2fc914fdfeb245f02558cf2d366f4bc20a981885f70865559d9bf4a0a68406",
|
|
23
23
|
"docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
|
|
24
24
|
"docs/naome/index.md": "sha256:cac748ed375d86d288460456fc5d606b29bd99d91148522c303d5400a083dbc5",
|
|
25
|
-
"docs/naome/task-ledger.md": "sha256:
|
|
25
|
+
"docs/naome/task-ledger.md": "sha256:7749e7e9484a2ae431230bf3568d0238ced81478304208bdfb3a12953b6f0a81",
|
|
26
26
|
"docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
|
|
27
27
|
});
|
|
28
28
|
|
|
@@ -15,14 +15,14 @@ const expectedMachineOwnedIntegrity = Object.freeze({
|
|
|
15
15
|
".naome/bin/naome.js": "sha256:8a9d9ed783981ef9750021fa30e92460283775bb4a0eacdea60b63041a9c6a05",
|
|
16
16
|
".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
|
|
17
17
|
".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
|
|
18
|
-
"AGENTS.md": "sha256:
|
|
19
|
-
"docs/naome/agent-workflow.md": "sha256:
|
|
18
|
+
"AGENTS.md": "sha256:28b51a5df52c90f21b62ecc110937cb254dbedcc22a36596a873dc02adb20623",
|
|
19
|
+
"docs/naome/agent-workflow.md": "sha256:3812a065adfbcdcacae42c93e58eedb90fa9439cd4d8fe97583d6718da9cb8af",
|
|
20
20
|
"docs/naome/architecture-fitness.md": "sha256:be38e0c6dea8b1ebeee3bfd4a2e4e17008829360b1b4649ef45f2ce61e7287bd",
|
|
21
21
|
"docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
|
|
22
|
-
"docs/naome/execution.md": "sha256:
|
|
22
|
+
"docs/naome/execution.md": "sha256:3e2fc914fdfeb245f02558cf2d366f4bc20a981885f70865559d9bf4a0a68406",
|
|
23
23
|
"docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
|
|
24
24
|
"docs/naome/index.md": "sha256:cac748ed375d86d288460456fc5d606b29bd99d91148522c303d5400a083dbc5",
|
|
25
|
-
"docs/naome/task-ledger.md": "sha256:
|
|
25
|
+
"docs/naome/task-ledger.md": "sha256:7749e7e9484a2ae431230bf3568d0238ced81478304208bdfb3a12953b6f0a81",
|
|
26
26
|
"docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
|
|
27
27
|
});
|
|
28
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"harnessVersion": "1.4.
|
|
2
|
+
"harnessVersion": "1.4.6",
|
|
3
3
|
"installedAt": null,
|
|
4
4
|
"integrity": {
|
|
5
5
|
".naome/bin/check-harness-health.js": "sha256:802d7419774981a6af1826b3882270ff8f41259d516f98c52a02b4ddc184c467",
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
".naome/bin/naome.js": "sha256:8a9d9ed783981ef9750021fa30e92460283775bb4a0eacdea60b63041a9c6a05",
|
|
8
8
|
".naome/package.json": "sha256:8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a",
|
|
9
9
|
".naome/task-contract.schema.json": "sha256:1b3b62350328d0d6d660e36d1d1baaa2b88718530db774f9ab2a9e2fcba369c8",
|
|
10
|
-
"AGENTS.md": "sha256:
|
|
11
|
-
"docs/naome/agent-workflow.md": "sha256:
|
|
10
|
+
"AGENTS.md": "sha256:28b51a5df52c90f21b62ecc110937cb254dbedcc22a36596a873dc02adb20623",
|
|
11
|
+
"docs/naome/agent-workflow.md": "sha256:3812a065adfbcdcacae42c93e58eedb90fa9439cd4d8fe97583d6718da9cb8af",
|
|
12
12
|
"docs/naome/architecture-fitness.md": "sha256:be38e0c6dea8b1ebeee3bfd4a2e4e17008829360b1b4649ef45f2ce61e7287bd",
|
|
13
13
|
"docs/naome/context-economy.md": "sha256:3ed5075815ecf4ada46a5e65438769310307c35759fcd46b13dc0b96e02bebd9",
|
|
14
|
-
"docs/naome/execution.md": "sha256:
|
|
14
|
+
"docs/naome/execution.md": "sha256:3e2fc914fdfeb245f02558cf2d366f4bc20a981885f70865559d9bf4a0a68406",
|
|
15
15
|
"docs/naome/first-run.md": "sha256:1466ce8c65e19a1514885f917db14e8a772350e3f6d1c03a66326963365919e1",
|
|
16
16
|
"docs/naome/index.md": "sha256:cac748ed375d86d288460456fc5d606b29bd99d91148522c303d5400a083dbc5",
|
|
17
|
-
"docs/naome/task-ledger.md": "sha256:
|
|
17
|
+
"docs/naome/task-ledger.md": "sha256:7749e7e9484a2ae431230bf3568d0238ced81478304208bdfb3a12953b6f0a81",
|
|
18
18
|
"docs/naome/upgrade.md": "sha256:2c60f0441bbd98bd528d109b30a7ded4b0ad55d61ffb9f52edac9e93b7999cb1"
|
|
19
19
|
},
|
|
20
20
|
"machineOwned": [
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
".naomeignore",
|
|
40
40
|
".naome/init-state.json",
|
|
41
41
|
".naome/manifest.json",
|
|
42
|
-
".naome/task-state.json",
|
|
43
42
|
".naome/upgrade-state.json",
|
|
44
43
|
".naome/verification.json",
|
|
45
44
|
".naome/repository-model.json",
|
|
@@ -8,7 +8,9 @@ This repository uses NAOME as its coding-agent harness.
|
|
|
8
8
|
2. Do not read paths matched by `.naomeignore`.
|
|
9
9
|
3. If `.naome/bin/check-harness-health.js` is missing, run
|
|
10
10
|
`naome sync --check-update` from the repository root, then restart.
|
|
11
|
-
4. Read `.naome/task-state.json
|
|
11
|
+
4. Read `.naome/task-state.json` when present; if it is missing, run
|
|
12
|
+
`node .naome/bin/naome.js task status --json` and use the derived idle or
|
|
13
|
+
ledger-backed state.
|
|
12
14
|
5. Run `node .naome/bin/check-harness-health.js`.
|
|
13
15
|
6. If harness health fails, stop normal feature work and repair with
|
|
14
16
|
`naome update` followed by `naome sync`, or ask for the listed decision.
|
|
@@ -125,9 +125,10 @@ Use this workflow after first-run intake is complete.
|
|
|
125
125
|
completion proof.
|
|
126
126
|
5. Record proof as compact `proofPathSets` and `proofBatches` in the local
|
|
127
127
|
ledger when many checks share evidence paths. Use local per-check proof files
|
|
128
|
-
only when separate writers need them during the run.
|
|
129
|
-
|
|
130
|
-
reported by git in expanded proof evidence
|
|
128
|
+
only when separate writers need them during the run. `.naome/task-state.json`
|
|
129
|
+
is a local generated compatibility projection; include every changed
|
|
130
|
+
in-scope path reported by git in expanded proof evidence, but do not commit
|
|
131
|
+
the projection.
|
|
131
132
|
6. Run `node .naome/bin/naome.js task render-state --write --json` before
|
|
132
133
|
external compatibility checks. Do not hand-edit the rendered projection when
|
|
133
134
|
`.naome/tasks/active.json` exists.
|
|
@@ -12,11 +12,11 @@ Status: Uninitialized
|
|
|
12
12
|
local runtime state, run evidence, and product source.
|
|
13
13
|
- Durable project state is committed repository or package state needed to
|
|
14
14
|
reinstall or reconstruct the harness.
|
|
15
|
-
- `.naome/task-state.json` is the
|
|
15
|
+
- `.naome/task-state.json` is the local generated task-state projection.
|
|
16
16
|
- `.naome/tmp/` and `.naome/tasks/` are local runtime state and must not be
|
|
17
17
|
committed.
|
|
18
18
|
- Per-check proof files are local run evidence. Prefer compact proof batches in
|
|
19
|
-
the
|
|
19
|
+
the local task-state projection when many release checks share the same
|
|
20
20
|
evidence paths.
|
|
21
21
|
- Prompt routing uses fenced `naome-prompt-envelope-v1` JSON envelopes as the
|
|
22
22
|
deterministic routing input. Raw natural-language prompts are audit text and
|
|
@@ -87,7 +87,7 @@ task.
|
|
|
87
87
|
|
|
88
88
|
## Start A Task
|
|
89
89
|
|
|
90
|
-
When starting work, update `.naome/task-state.json`:
|
|
90
|
+
When starting work, update the local task ledger or generated compatibility projection `.naome/task-state.json`:
|
|
91
91
|
|
|
92
92
|
- set `status` to `planning`
|
|
93
93
|
- set `activeTask.id` to a short kebab-case id
|
|
@@ -159,14 +159,14 @@ Compact proof batches are lossless: `proofPathSets` names shared evidence,
|
|
|
159
159
|
explicitly on the proof or batch.
|
|
160
160
|
|
|
161
161
|
Do not reset `.naome/task-state.json` to idle just to hide the completed task.
|
|
162
|
-
The completed task state is
|
|
163
|
-
|
|
164
|
-
tree is clean.
|
|
162
|
+
The completed task state is local runtime memory and must not be committed with
|
|
163
|
+
the task diff. The next admitted task may overwrite or regenerate the local
|
|
164
|
+
projection after the working tree is clean.
|
|
165
165
|
|
|
166
166
|
Deleted-file proof remains valid after baseline when the file was deleted
|
|
167
167
|
between `activeTask.admission.gitHead` and current `HEAD`. The checker uses
|
|
168
|
-
that historical task diff after the working tree is clean, so completed
|
|
169
|
-
state can
|
|
168
|
+
that historical task diff after the working tree is clean, so local completed
|
|
169
|
+
task state can remain available without requiring the deleted file to exist.
|
|
170
170
|
|
|
171
171
|
If the check passes but prints a next-task admission notice, keep the final
|
|
172
172
|
handoff short and use NAOME route/status `userMessage` for the next step. List
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Task Ledger
|
|
2
2
|
|
|
3
3
|
NAOME task state is moving from one mutable aggregate file to a local task
|
|
4
|
-
ledger. The compatibility file `.naome/task-state.json`
|
|
5
|
-
|
|
4
|
+
ledger. The compatibility file `.naome/task-state.json` is a generated
|
|
5
|
+
local-only projection, while `.naome/tasks/` is machine-local runtime state for
|
|
6
6
|
efficient task updates.
|
|
7
7
|
|
|
8
8
|
## Layout
|
|
@@ -35,9 +35,10 @@ efficient task updates.
|
|
|
35
35
|
|
|
36
36
|
Existing `naome.task-state.v1` and `naome.task-state.v2` files remain valid. If
|
|
37
37
|
a current local ledger exists, NAOME readers build a canonical task model from
|
|
38
|
-
it and render a `naome.task-state.v2` projection. If
|
|
39
|
-
|
|
40
|
-
projection
|
|
38
|
+
it and can render a `naome.task-state.v2` projection. If neither the local
|
|
39
|
+
ledger nor the projection exists, readers derive a stable idle state. If an
|
|
40
|
+
older tracked completed projection has proof detail that an incomplete local
|
|
41
|
+
ledger lacks, readers keep that legacy projection for backwards compatibility.
|
|
41
42
|
|
|
42
43
|
Use this command when an external tool needs the compatibility file refreshed:
|
|
43
44
|
|
|
@@ -54,14 +55,17 @@ node .naome/bin/naome.js task migrate-ledger --write --json
|
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
After `.naome/tasks/active.json` exists, `.naome/task-state.json` is a rendered
|
|
57
|
-
compatibility projection.
|
|
58
|
-
|
|
58
|
+
compatibility projection. `naome sync` adds it to `.git/info/exclude` and
|
|
59
|
+
removes any tracked copy from the git index without deleting the local file.
|
|
60
|
+
NAOME gates can operate from the local ledger even when the projection is
|
|
61
|
+
missing.
|
|
59
62
|
|
|
60
63
|
## Conflict Policy
|
|
61
64
|
|
|
62
|
-
`.naome/tasks/`
|
|
63
|
-
`naome sync`, and not task feature scope or proof
|
|
64
|
-
control files when checking whether product
|
|
65
|
+
`.naome/task-state.json` and `.naome/tasks/` are local NAOME runtime state.
|
|
66
|
+
They are ignored, untracked by `naome sync`, and not task feature scope or proof
|
|
67
|
+
evidence. Gates ignore these control files when checking whether product
|
|
68
|
+
changes stay inside `allowedPaths` or which paths should be committed.
|
|
65
69
|
|
|
66
70
|
The intended long-term model is:
|
|
67
71
|
|
|
@@ -81,6 +85,6 @@ instead of all competing for `.naome/task-state.json`.
|
|
|
81
85
|
Use `node .naome/bin/naome.js workflow information --path <path> --json` before
|
|
82
86
|
changing NAOME control files whose retention is unclear. Durable configuration
|
|
83
87
|
and templates are restored from repository or package state.
|
|
84
|
-
`.naome/task-state.json` is the
|
|
88
|
+
`.naome/task-state.json` is the local generated task projection. `.naome/tmp/`
|
|
85
89
|
and `.naome/tasks/` are local runtime state. Compact release proof batches keep
|
|
86
90
|
release diffs readable without tracking per-task runtime folders.
|