taskforce-loop-engineering 0.16.3 → 0.16.5
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/CHANGELOG.md +24 -0
- package/docs/isolated-verification.md +30 -3
- package/lib/context-budget.mjs +9 -1
- package/lib/core.mjs +348 -50
- package/lib/isolated-verification.mjs +14 -1
- package/package.json +2 -2
- package/scripts/async-acceptance-refresh-self-test.mjs +3 -0
- package/scripts/context-budget-self-test.mjs +25 -7
- package/scripts/continuation-regression-self-test.mjs +175 -0
- package/scripts/final-judgement-self-test.mjs +243 -1
- package/scripts/isolated-verification-self-test.mjs +31 -2
- package/scripts/isolated-verify-self-test.py +32 -0
- package/scripts/isolated-verify.py +122 -9
- package/scripts/revision-coverage-self-test.mjs +105 -0
- package/scripts/route-notify-self-test.mjs +12 -1
- package/skills/taskforce-loop-engineering/SKILL.md +18 -1
- package/skills/taskforce-loop-engineering/references/context-budget.md +1 -1
- package/skills/taskforce-loop-engineering/references/scope-task-acceptance.md +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.16.5 - 2026-11-02
|
|
6
|
+
|
|
7
|
+
Security and correctness release for 0.16.1–0.16.4. Publication does not upgrade installed CLIs or generated integrations; re-run `loop-engineering-openclaw-manage --action upgrade --confirm-upgrade` (Hermes: rerun the installer with `--confirm-install --force`).
|
|
8
|
+
|
|
9
|
+
- Keep a task's milestone identity across revision rounds, runtime and orphan recovery and operator requeues; it only advances after an accepted milestone continues the project. The 0.16.1–0.16.4 template renamed the milestone on every dispatch, so a bounded task revised along the template could never be accepted and a resolved historical blocker vetoed it. Checkpoints that declare `revises_checkpoint_id` now join the chain they revise, which also repairs records written by those versions.
|
|
10
|
+
- A project run recovered after a runtime interruption no longer fails as "no new accepted milestone" or "accepted checkpoints do not cover required": work written by the interrupted run counts as progress (recovery stays bounded by `retry.runtimeRecoveryMaxAttempts`).
|
|
11
|
+
- Cap consecutive context handoffs (`retry.maxContextHandoffs`, default 10, reset when a milestone is accepted): a worker whose verification evidence differed every turn (e.g. a run-specific log path) could hand off forever, starting a new paid session each tick.
|
|
12
|
+
- Blockers and uncertain external actions written only in a context handoff are now recorded in the final judgement (`handoff_blockers`, `handoff_pending_actions`, reasons and next actions) and listed in the terminal notification. A handoff is passed only to the session right after it, so a later session is no longer shown an out-of-date `nextAction`.
|
|
13
|
+
- Scope inference ignores 不/别 inside ordinary words (特别, 不同, 区别 ...), does not treat "第一步之后" as a bounded cue, and splits clauses at " - " and "without X, complete Y"; real negations ("不要只处理", "不仅是有界里程碑") still mark a project.
|
|
14
|
+
- A checkpoint whose `verification` is not an array no longer crashes acceptance through revision coverage (the task used to stick in `active/` and be re-dispatched); with several planned milestones a review counts only for the milestone it names, so one accepted revision cannot cover two milestones; an unreadable gate, task or checkpoint is skipped during gate reconciliation instead of failing every run of the queue.
|
|
15
|
+
- **Security:** isolated verification started by root now passes `--cap-drop ALL` to bwrap and masks root-only secrets of the bound `/etc` (`shadow`, `gshadow`, `sudoers`, SSH host keys, `ssl/private`); previously a root host gave the sandbox full capabilities, so a verification command could remount `/usr` or `/etc` read-write, modify host binaries and still pass, and could read `/etc/shadow`. Run the supervisor as a non-root user for full identity separation.
|
|
16
|
+
- The undeclared-input audit follows symlinks the command creates (including renamed and relative ones) and rejects another thread's `/proc/.../task/<tid>/` aliases, so `ln -s /work /tmp/w; cat /tmp/w/hidden.txt` no longer passes unnoticed.
|
|
17
|
+
- Fix intermittent false failures of isolated verification when processes are killed in `exit_group` or `wait4` during PID-namespace teardown (`unfinished`/`overlapping file syscall`).
|
|
18
|
+
- The isolation supervisor's timeout now covers input freezing, and SIGTERM tears down the traced sandbox, so a caller timeout no longer orphans strace, bwrap and the command.
|
|
19
|
+
- A failed isolated verification reports its `reason`; the live isolation self-test names missing tools (`LOOP_SKIP_ISOLATION_TESTS=1` skips it) instead of failing on an unrelated `stderr.log` read.
|
|
20
|
+
|
|
21
|
+
## 0.16.4 - 2026-10-29
|
|
22
|
+
|
|
23
|
+
- Measure project continuation by newly accepted, evidence-bound milestone identities, preserving explicit and inferred project plans; renamed plans and duplicate snapshots no longer count as progress.
|
|
24
|
+
- Allow bounded repair of malformed checkpoint history without treating unknown baselines as empty acceptance. Preserve human gates and require an explicit validated revision before continuation.
|
|
25
|
+
- Separate successful evidence-bearing context handoffs from capped exception recovery; repeated or empty verification still stops and human blockers remain authoritative.
|
|
26
|
+
- Close unordered status-only phases with explicit same-scope, hash-bound revision coverage. Preserve history, real defects, corrupt evidence and cross-milestone boundaries; reject invalid coverage laundering.
|
|
27
|
+
- Add Node 22/24 regression coverage and synchronize the distributed skill. Publication does not upgrade installed CLIs or integrations.
|
|
28
|
+
|
|
5
29
|
## 0.16.3 - 2026-10-27
|
|
6
30
|
|
|
7
31
|
- Preserve task-scoped human-input gates during reconciliation; keep task acceptance distinct from project completion and unresolved authority blockers.
|
|
@@ -42,8 +42,22 @@ same input digest. Failed file accesses are checked against the recorded working
|
|
|
42
42
|
directory or directory descriptor, including nested paths and resumed calls.
|
|
43
43
|
Swallowing a missing undeclared input error does not make verification pass.
|
|
44
44
|
Missing, malformed, stale, or red receipts fail verification.
|
|
45
|
-
The queue run records the evidence directory and
|
|
46
|
-
|
|
45
|
+
The queue run records the evidence directory, digest and, for a failed run, a
|
|
46
|
+
short `reason` (supervisor error, read-audit violation, timeout or failed
|
|
47
|
+
receipt check) in its verification artifact.
|
|
48
|
+
|
|
49
|
+
The sandboxed command holds no capabilities. When the supervisor runs as root,
|
|
50
|
+
bwrap is started with `--cap-drop ALL`, so the command can neither remount the
|
|
51
|
+
read-only system binds nor write the host `/usr` or `/etc`; the usual root-only
|
|
52
|
+
secrets of the bound `/etc` (`shadow`, `gshadow`, `sudoers`, SSH host keys,
|
|
53
|
+
`ssl/private`) are masked. The sandbox identity still maps to host root, so
|
|
54
|
+
other root-only files in the bound system directories remain readable: run the
|
|
55
|
+
supervisor as a non-root user when that matters. (Running the sandbox as an
|
|
56
|
+
unprivileged identity under root is not portable: hosts that restrict
|
|
57
|
+
unprivileged user namespaces, such as Ubuntu 23.10+, deny it the capabilities
|
|
58
|
+
bwrap needs to set up the sandbox network.) The supervisor's `--timeout` covers freezing as well as the
|
|
59
|
+
command, and a SIGTERM to the supervisor tears down the traced sandbox, which
|
|
60
|
+
runs in its own session. `code-task-run` repeats isolated verification after applying a
|
|
47
61
|
reviewed patch; its evidence lives beside the project root in
|
|
48
62
|
`.loop-isolation-evidence/<task-id>/`.
|
|
49
63
|
|
|
@@ -74,8 +88,21 @@ The supervisor models its explicit mount roots and runtime-file ancestors;
|
|
|
74
88
|
unresolved traversal through dynamic external mounts or symlink ancestors fails
|
|
75
89
|
closed. This is bounded trace auditing, not unrestricted syscall emulation.
|
|
76
90
|
|
|
91
|
+
Symlinks the command creates (in `/tmp` or `/out`, which start empty) are
|
|
92
|
+
recorded from the trace, followed through renames, and resolved before a failed
|
|
93
|
+
access is audited, so probing an undeclared input through such a link is still
|
|
94
|
+
rejected. Process exits and child waits that never return during PID-namespace
|
|
95
|
+
teardown are not treated as unfinished file syscalls.
|
|
96
|
+
|
|
77
97
|
Failed `/proc/self/cwd`, `/proc/thread-self/cwd` and self `root` probes are
|
|
78
98
|
resolved using the traced process cwd or the sandbox root before source-input
|
|
79
99
|
auditing. Raw suffix components are retained. Unresolved process/fd aliases
|
|
80
|
-
(including `/dev/fd`) fail closed; optional accesses via unknown dynamic aliases
|
|
100
|
+
(including `/dev/fd` and another thread's `/proc/.../task/<tid>/` view) fail closed; optional accesses via unknown dynamic aliases
|
|
81
101
|
may therefore be rejected. This does not claim general procfs emulation.
|
|
102
|
+
|
|
103
|
+
## Running the self-tests
|
|
104
|
+
|
|
105
|
+
`npm test` starts with the live sandbox tests and needs Linux with bubblewrap,
|
|
106
|
+
strace and Python 3 (`apt-get install bubblewrap strace python3`). Without them
|
|
107
|
+
the test names the missing tools and fails; set `LOOP_SKIP_ISOLATION_TESTS=1`
|
|
108
|
+
to skip only those live tests on a machine that cannot run the sandbox.
|
package/lib/context-budget.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StringDecoder } from 'node:string_decoder';
|
|
2
2
|
import { DEFAULT_REQUIRES_HUMAN_ACTION_PATTERNS, DEFAULT_RECOVERABLE_RUNTIME_PATTERNS } from './dispatch-classification.mjs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
4
5
|
import { createWriteStream } from 'node:fs';
|
|
5
6
|
import { finished } from 'node:stream/promises';
|
|
6
7
|
import { open, realpath, writeFile } from 'node:fs/promises';
|
|
@@ -142,6 +143,13 @@ export async function handoffCheckpoint(value, { root, checkpointsDir, taskId, r
|
|
|
142
143
|
if (!relative || relative.startsWith('..') || path.isAbsolute(relative)) return { valid: false };
|
|
143
144
|
const cp = await readBoundedJson(file);
|
|
144
145
|
if (!cp || cp.task_id !== taskId || cp.loop_run_id !== runId || !Array.isArray(cp.blockers)) return { valid: false };
|
|
145
|
-
|
|
146
|
+
// Exclude transport IDs, prose and timestamps: rotating sessions or merely
|
|
147
|
+
// renaming a checkpoint cannot constitute progress. Require recorded checks.
|
|
148
|
+
const checks = Array.isArray(cp.verification) ? cp.verification.filter(x =>
|
|
149
|
+
(typeof x === 'string' && x.trim()) || (x && typeof x === 'object' && Object.keys(x).length)) : [];
|
|
150
|
+
const canonical = x => Array.isArray(x) ? x.map(canonical) : x && typeof x === 'object'
|
|
151
|
+
? Object.fromEntries(Object.keys(x).sort().map(k => [k, canonical(x[k])])) : x;
|
|
152
|
+
const progressFingerprint = checks.length ? createHash('sha256').update(JSON.stringify(canonical(checks))).digest('hex') : null;
|
|
153
|
+
return { valid: true, progressFingerprint, blocked: cp.blockers.length > 0 || ['blocked', 'needs_human_input'].includes(cp.status) };
|
|
146
154
|
} catch { return { valid: false }; }
|
|
147
155
|
}
|