taskforce-loop-engineering 0.16.0 → 0.16.2
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 +23 -0
- package/README.md +12 -0
- package/lib/context-budget.mjs +147 -0
- package/lib/core.mjs +113 -142
- package/lib/dispatch-classification.mjs +114 -0
- package/lib/openclaw-diagnostic-source.mjs +71 -0
- package/package.json +3 -3
- package/scripts/context-budget-self-test.mjs +249 -0
- package/scripts/final-judgement-self-test.mjs +92 -4
- package/scripts/openclaw-diagnostic-source-self-test.mjs +27 -0
- package/scripts/openclaw-doctor.mjs +27 -8
- package/scripts/openclaw-install-self-test.mjs +222 -4
- package/scripts/openclaw-install.mjs +63 -13
- package/scripts/openclaw-smoke.mjs +14 -5
- package/scripts/safety-regression-self-test.mjs +4 -3
- package/skills/taskforce-loop-engineering/SKILL.md +12 -0
- package/skills/taskforce-loop-engineering/references/context-budget.md +11 -0
- package/skills/taskforce-loop-engineering/references/npm-package.md +8 -1
- package/skills/taskforce-loop-engineering/references/openclaw-diagnostics.md +93 -0
|
@@ -90,6 +90,12 @@ loop-engineering-openclaw-smoke \
|
|
|
90
90
|
|
|
91
91
|
If the CLI or integration is missing and the user requested installation or repair, install it within the authorized host/workspace scope, then run doctor and the disposable smoke. If the user only asked what is missing, report the exact package, repository, commands, and current deployment state without mutating the system.
|
|
92
92
|
|
|
93
|
+
### Multi-IM Diagnostic Acceptance
|
|
94
|
+
|
|
95
|
+
Before OpenClaw doctor/smoke, follow [the multi-IM diagnostic procedure](references/openclaw-diagnostics.md): select the correct CLI/profile, check installed capabilities, and discover actual channels/accounts rather than assuming Feishu. Doctor probes all matching accounts; smoke exercises one selected source per run. For multi-channel acceptance, explicitly test each required channel/account pair and record the coverage.
|
|
96
|
+
|
|
97
|
+
Notification probes are dry-run only, not evidence of real delivery or authenticated inbound approval support. Smoke still executes a real worker in a disposable queue. Updating this skill alone does not upgrade the installed CLI; the discovery/selection behavior requires package version 0.16.2 or newer; 0.16.1 does not include it.
|
|
98
|
+
|
|
93
99
|
### Hermes Agent Integration
|
|
94
100
|
|
|
95
101
|
The core CLI is platform-neutral, but Hermes conversation routing requires its own dispatcher and notifier. Generate a plan and verify its installation confirmation summary identifies Hermes, the absolute Hermes CLI path, intended workspace and queue, systemd scheduler, source-bound notification routing, and `writes enabled: no (plan only)`. If any field identifies the wrong platform or destination, stop. Confirm installation only after that review, then run the read-only doctor and disposable smoke:
|
|
@@ -138,6 +144,8 @@ Interpret explicit loop language as follows:
|
|
|
138
144
|
- `继续当前 loop,补充要求:…`: amend the active task in place. Preserve the task id and worker session, write a versioned amendment, update the task contract/dev plan/acceptance plan, and require the worker to reread the latest amendment before checkpoints and completion.
|
|
139
145
|
- A new explicit `走 loop` request while another task is active is a correction/replacement, not ordinary backlog. Supersede the active task at a safe boundary, retain its evidence and lineage, then start the replacement after the lock is released.
|
|
140
146
|
- Status, progress, evidence, or failure questions are read-only and must not start another tick unless the user explicitly asks to continue/run.
|
|
147
|
+
- For status questions, read the latest checkpoint, verification result and worker liveness, then reply before doing further work. A failed check is a result to report, not authorization to edit files, rebuild images or rerun tests in the chat session. Send authorized follow-up execution to the task's independent worker session; never adopt its implementation into the conversation session.
|
|
148
|
+
- Conversation routing starts a background worker and returns a launch receipt; it must not await the full worker tick. A receipt proves process launch only, not lock acquisition, task execution, or acceptance. The background entry waits for a confirmed queue-lock conflict for up to five minutes by default; only exit code 2 with JSON status=locked and processed=false is retried. Read the launch log and queue state after timeout; do not start a duplicate worker from the chat. Keep scheduler/manual `run-once` execution synchronous and inspect its final artifacts separately.
|
|
141
149
|
|
|
142
150
|
Do not infer a queue or dispatcher from this skill. Use the integration installed in the current workspace. For OpenClaw, inspect the generated queue configuration under `configs/loops/queues/` and use the managed wrapper when present. A default installation uses queue `agent-tasks` and the generic wrapper below; an operator may choose another queue or worker during installation.
|
|
143
151
|
|
|
@@ -152,6 +160,10 @@ If the managed wrapper or queue configuration is absent, stop and run the platfo
|
|
|
152
160
|
|
|
153
161
|
Pass the original request faithfully. Preserve source channel, target, account, message id, and reply-to metadata so progress, human gates, and terminal results return to the originating conversation. Missing delivery routing must fail closed.
|
|
154
162
|
|
|
163
|
+
## Context Budget and Durable Handoff
|
|
164
|
+
|
|
165
|
+
For OpenClaw workers, follow `references/context-budget.md` before long-running work or recovery. Keep one bounded objective per turn, read bounded file ranges, and save checkpoints instead of replaying transcripts. Resolve paths against the resume manifest's workspace root; preserve authority, amendments, and action receipts across session rotation. A handoff is incomplete work, not acceptance. Verify the installed dispatcher and queue policy before claiming these protections are active.
|
|
166
|
+
|
|
155
167
|
## Task vs Project Classification
|
|
156
168
|
|
|
157
169
|
Classify scope before enqueueing.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Context budget and recovery
|
|
2
|
+
|
|
3
|
+
1. Inspect the installed OpenClaw dispatcher and queue `retry` configuration. New installations use `sessionMaxTicks: 3` and `contextBudget: { softRatio: 0.60, hardRatio: 0.75 }`. Existing explicit tick limits are retained until a reviewed integration upgrade. A package/skill update alone does not update generated workspace files. Hermes does not yet expose the OpenClaw telemetry adapter; do not claim equivalent telemetry protection there.
|
|
4
|
+
2. Keep one bounded objective per worker turn. Request file ranges and filtered results, aim for tool responses below 8 KiB, and save full logs to artifacts. Large task bodies are referenced through `LOOP_TASK_FILE` rather than inlined. These are worker instructions, not a universal cap on tool output or an in-turn token interrupt.
|
|
5
|
+
3. Read `LOOP_RESUME_FILE`, the task contract/plans, latest amendment and latest relevant checkpoint. Resolve relative references against its `workspaceRoot`. Read a previous handoff only for outstanding context; newer checkpoints and amendments take precedence. Do not reload complete transcripts or all historical checkpoints.
|
|
6
|
+
4. At roughly 60% context use, prepare a checkpoint; at 75%, stop adding work and hand off. If live usage is not available, use a small work unit rather than inventing a percentage. The OpenClaw adapter measures the final prompt after the worker exits from `agentMeta.lastCallUsage.input + cacheRead` against `agentMeta.contextTokens`; aggregate `usage` is not context occupancy. Cache-write tokens are not added again. Missing, malformed or oversized CLI JSON falls back to tick-based rotation. This sample is not a live high-water mark: runtime compaction may already have reduced it.
|
|
7
|
+
5. For unfinished work requiring a new session, write a normal progress checkpoint with `task_id`, `loop_run_id`, and `blockers`, then the bounded JSON handoff at `LOOP_CONTEXT_HANDOFF_FILE` using the schema provided in the worker prompt. Include task/run/generation/attempt binding, the checkpoint path, summary, completed and remaining work, evidence, next action, authority, pending external actions and blockers. Keep it under 16 KiB and omit secrets. The runner validates binding and a real checkpoint inside this task's checkpoint directory; missing/malformed/stale evidence stops recovery rather than accepting the task.
|
|
8
|
+
6. Verify pending external, paid or destructive actions against durable receipts/reservations before replay. Uncertain outcomes and authority blockers stop automatic continuation, including when the worker exits nonzero. An existing handoff is checked before any retry; malformed or stale handoffs fail closed. A clean handoff never overrides a permission failure. Effective blocked checkpoint reviews are checked before each ordinary dispatch retry and also veto runtime recovery when interruption happens before handoff creation. Ordinary and verification failures with effective blockers remain `needs_human_input`, not development revisions; resolved historical blockers do not. Record checkpoint `created_at` (UTC) and, when known, a task-monotonic numeric `sequence`; checkpoint IDs and regenerated review timestamps are not ordering evidence. Conflicting or missing chronology preserves unresolved reviews rather than guessing from names. A newer unblocked snapshot with unambiguous chronology can resolve historical blockers. Multi-milestone plans use the same rule within each milestone and count each planned milestone only once. Terminal acceptance may ignore a chronologically later `needs_human_acceptance` project snapshot only if that review independently passes acceptance and carries no materializable deferred gates. The project label alone cannot hide a blocked/revise review; missing blocker details are not proof of broader-project-only governance. Test accepted terminal + later unknown external outcome under ordinary failure (one and multiple attempts), overflow, incomplete turn and exhausted recovery, including the generated dispatcher. The veto must prevent queue re-entry, not merely change the judgement report. A handoff cannot authorize an action. The runner preserves the task id and increments the session generation on a validated handoff or recognized context overflow; it never retries a known runtime interruption in the same session. Consecutive runtime recoveries (including voluntary handoffs) share `runtimeRecoveryMaxAttempts`, default 2; exhaustion stops as `runtime_blocked`. Accepted project progress resets that recovery counter.
|
|
9
|
+
7. Inspect task/run artifacts after each tick. Accepted unfinished project milestones rotate at the soft/hard threshold or tick limit, whichever occurs first; completed tasks are never requeued just because usage is high. Handoffs remain `runtime_interrupted`, not completed. Full worker stdout/stderr stay in per-run/per-attempt logs; bounded tails plus deduplicated diagnostic signatures reach the runner. Signatures are matched across the complete stream before clipping (including split UTF-8 chunks), using the queue's configured patterns; human-action classification retains priority over runtime recovery. CLI JSON parsing is capped at 2 MiB. No protection here guarantees that one tool-heavy turn cannot overflow: worker discipline and the underlying runtime's compaction remain necessary.
|
|
10
|
+
|
|
11
|
+
Validate with `node scripts/context-budget-self-test.mjs` and `node scripts/openclaw-install-self-test.mjs` in a source checkout. Use disposable queues and mocked workers; do not probe production queues or paid providers for these tests.
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# npm Package
|
|
2
2
|
|
|
3
3
|
Package name: `taskforce-loop-engineering`
|
|
4
|
-
Version: `
|
|
4
|
+
Version source: the candidate checkout's `package.json`; do not infer the installed
|
|
5
|
+
or public-registry version from this skill. Check the actual installed package
|
|
6
|
+
and `npm view taskforce-loop-engineering version` separately.
|
|
7
|
+
|
|
8
|
+
The multi-IM OpenClaw diagnostic changes require `0.16.2` or newer;
|
|
9
|
+
the `0.16.1` package does not support them. A skill update alone does
|
|
10
|
+
not install these capabilities. See [OpenClaw multi-IM diagnostics](openclaw-diagnostics.md)
|
|
11
|
+
for capability checks, channel/account selection, and acceptance boundaries.
|
|
5
12
|
|
|
6
13
|
Install from npm:
|
|
7
14
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# OpenClaw Multi-IM Diagnostics
|
|
2
|
+
|
|
3
|
+
## Compatibility and scope
|
|
4
|
+
|
|
5
|
+
This procedure requires package version 0.16.2 or newer; 0.16.1 does not
|
|
6
|
+
include these capabilities. Until a compatible release is installed, use a reviewed
|
|
7
|
+
source candidate for validation and report installed diagnostics as unchanged. Do not
|
|
8
|
+
pass new flags to an old binary or claim that updating the skill upgrades code.
|
|
9
|
+
This procedure applies to OpenClaw; it does not change Hermes diagnostics.
|
|
10
|
+
|
|
11
|
+
1. Identify the installed package, managed workspace, worker and queue. Check
|
|
12
|
+
`loop-engineering-openclaw-doctor --help` and
|
|
13
|
+
`loop-engineering-openclaw-smoke --help` for all three source flags below.
|
|
14
|
+
Help alone is not acceptance: verify discovery and dry-run report results.
|
|
15
|
+
2. Select the intended OpenClaw CLI/profile environment. `--root` selects a
|
|
16
|
+
workspace, not an OpenClaw profile. Both commands accept `--openclaw-bin`
|
|
17
|
+
for the selected executable; retain that profile's normal environment.
|
|
18
|
+
Inspect `openclaw channels list --json` using that same CLI/environment.
|
|
19
|
+
Doctor resolves executable aliases and requires the same executable as the
|
|
20
|
+
install manifest, plus unchanged manifest hashes for notifier/dispatcher.
|
|
21
|
+
A missing/incomplete manifest, different CLI, or caller drift fails
|
|
22
|
+
`diagnostic_runtime`: no notification probe or smoke worker runs. Choose
|
|
23
|
+
the installed CLI or repair the integration within the authorized scope;
|
|
24
|
+
`--openclaw-bin` does not rewrite installed callers.
|
|
25
|
+
Never print channel credentials to diagnose selection.
|
|
26
|
+
3. Run doctor. Without source filters, it discovers channel/account pairs from
|
|
27
|
+
the inventory and dry-runs each through the installed notifier. Inspect
|
|
28
|
+
`notificationSources` and the per-account `notification_dry_run` checks.
|
|
29
|
+
A configured inventory is not proof of a connected channel.
|
|
30
|
+
4. Run smoke only within the authorized worker-execution scope. It first
|
|
31
|
+
requires doctor to pass, then uses the first returned source for the isolated
|
|
32
|
+
task's routing and terminal notification dry-run. It executes a real worker,
|
|
33
|
+
so it is not merely a read-only notification probe and may consume model
|
|
34
|
+
resources. It removes its temporary queue/config/runtime unless
|
|
35
|
+
`--keep-artifacts` is requested; verify cleanup and required task artifacts.
|
|
36
|
+
5. For acceptance across multiple IMs/accounts, repeat smoke with explicit
|
|
37
|
+
channel/account pairs. One default smoke does not cover every configured
|
|
38
|
+
route. Report tested pairs, failures, retained evidence and cleanup status.
|
|
39
|
+
|
|
40
|
+
## Explicit selection
|
|
41
|
+
|
|
42
|
+
Both doctor and smoke accept:
|
|
43
|
+
|
|
44
|
+
- `--source-channel`: filter to an actual configured IM channel.
|
|
45
|
+
- `--source-account`: filter to an actual account ID. Pair with a channel to
|
|
46
|
+
avoid matching the same account name across different IMs.
|
|
47
|
+
- `--source-target`: override the synthetic dry-run destination when a plugin
|
|
48
|
+
requires a particular target format. This does not enable real sending or
|
|
49
|
+
change channel/account discovery.
|
|
50
|
+
|
|
51
|
+
For a configured Telegram account named `personal` (replace all placeholders
|
|
52
|
+
and select its actual profile environment first):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
loop-engineering-openclaw-doctor --root /path/to/workspace --queue agent-tasks --worker-agent main --source-channel telegram --source-account personal --source-target 1 --json
|
|
56
|
+
loop-engineering-openclaw-smoke --root /path/to/workspace --queue agent-tasks --worker-agent main --source-channel telegram --source-account personal --source-target 1 --json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Targets are synthetic by default. Discovery failure, malformed/empty channel
|
|
60
|
+
inventory or unmatched filters must fail closed; never fall back to Feishu or
|
|
61
|
+
silently drop the account. Within the selected channels, malformed account
|
|
62
|
+
lists or non-string/blank account entries fail even alongside valid entries
|
|
63
|
+
and even when an account filter would exclude them. An explicit channel filter
|
|
64
|
+
excludes unrelated channels from validation. Empty account arrays are valid,
|
|
65
|
+
but fail selection if no matching accounts remain. Correct the profile or selection instead of editing
|
|
66
|
+
a temporary test script to hardcode another IM.
|
|
67
|
+
|
|
68
|
+
## Evidence boundaries
|
|
69
|
+
|
|
70
|
+
Notification probes remain dry-run even with an explicit target. Passing them
|
|
71
|
+
proves only the tested routing/argument path, not real outbound delivery,
|
|
72
|
+
inbound reception, or trusted approval callback transport. Real end-to-end
|
|
73
|
+
messaging requires separate authorization and observed delivery/receipt.
|
|
74
|
+
Do not infer universal IM support from Feishu, Telegram and Slack mock tests;
|
|
75
|
+
other configured plugins need their own acceptance evidence. Keep diagnostic
|
|
76
|
+
coverage distinct from production notification and human-gate support.
|
|
77
|
+
|
|
78
|
+
### Diagnostic invocation and environment isolation
|
|
79
|
+
|
|
80
|
+
After checking executable identity and managed caller hashes, doctor uses the
|
|
81
|
+
exact CLI invocation recorded by installation for version, agent, channel and
|
|
82
|
+
notification checks. PATH/symlink aliases remain accepted when they resolve to
|
|
83
|
+
the same executable, but their invocation names are not used to select a second
|
|
84
|
+
profile. To change the installed profile, explicitly repair the integration.
|
|
85
|
+
Equal realpaths alone do not establish profile equivalence for name-sensitive
|
|
86
|
+
wrappers.
|
|
87
|
+
|
|
88
|
+
Doctor notification probes and smoke subprocesses discard inherited
|
|
89
|
+
`LOOP_HUMAN_INPUT_SOURCE` and `LOOP_NOTIFICATION_SOURCE` before supplying their
|
|
90
|
+
own discovered/task source. Production human-gate source precedence is unchanged.
|
|
91
|
+
Regression checks compare reported channel/account/target against captured
|
|
92
|
+
message arguments (including `--dry-run`), with conflicting inherited sources,
|
|
93
|
+
multiple accounts, and invocation-name-sensitive wrappers.
|