taskforce-loop-engineering 0.13.0 → 0.15.0
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 +10 -0
- package/README.md +15 -1
- package/docs/adapter-sdk-terminal-contract.json +19 -0
- package/docs/production-trust-backlog.json +13 -8
- package/docs/production-trust-contract.md +53 -54
- package/docs/runtime-adapter-sdk.md +50 -0
- package/examples/adapter-sdk-demo.mjs +9 -0
- package/examples/code-worktree-queue.json +35 -0
- package/examples/queue-runner.json +37 -0
- package/examples/safe-canary.mjs +5 -0
- package/examples/workspace-health.json +35 -0
- package/lib/action-reservations.mjs +7 -0
- package/lib/core.mjs +473 -74
- package/lib/execution-ledger.mjs +41 -0
- package/lib/operator-dashboard.mjs +18 -4
- package/lib/production-evidence.mjs +54 -0
- package/lib/runtime-adapter-sdk.mjs +115 -0
- package/package.json +6 -2
- package/scripts/execution-ledger-self-test.mjs +10 -0
- package/scripts/final-judgement-self-test.mjs +20 -1
- package/scripts/live-runtime-soak.mjs +14 -3
- package/scripts/operator-dashboard-self-test.mjs +10 -0
- package/scripts/production-acceptance.mjs +2 -0
- package/scripts/production-evidence-self-test.mjs +17 -0
- package/scripts/production-soak.mjs +41 -17
- package/scripts/project-gate-reconciliation-self-test.mjs +107 -0
- package/scripts/route-notify-self-test.mjs +51 -0
- package/scripts/runtime-adapter-conformance.mjs +21 -0
- package/templates/github-production-trust.yml +20 -0
- package/templates/production-evidence.schema.json +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.15.0 - 2026-08-20
|
|
6
|
+
|
|
7
|
+
- Reconcile project-scoped human gates against the authoritative project contract and acceptance ledger, superseding stale or optional deferred gates without replay.
|
|
8
|
+
- Strengthen doctor and project status checks for structured gate context, acceptance-ledger drift, execution-ledger reconciliation, and project completion.
|
|
9
|
+
- Make active-task supersession project-aware across active and waiting tasks, and add end-to-end regression coverage for durable gate materialization.
|
|
10
|
+
|
|
11
|
+
## 0.14.0 - 2026-08-14
|
|
12
|
+
|
|
13
|
+
- Add the platform-neutral runtime adapter SDK v1 with OpenClaw, Hermes, Codex CLI, and Claude Code factories, shared conformance tests, fail-closed effects, redacted telemetry, migration guidance, and a credential-free demo.
|
|
14
|
+
|
|
5
15
|
## 0.13.0 - 2026-08-14
|
|
6
16
|
|
|
7
17
|
- Add versioned OpenClaw, Hermes, and custom runtime adapter contracts with a shared conformance suite.
|
package/README.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Taskforce Loop Engineering
|
|
2
2
|
|
|
3
|
+
[](https://github.com/ambitioncn/taskforce-loop-engineering/actions/workflows/production-trust.yml)
|
|
4
|
+
|
|
5
|
+
## Platform-neutral adapter SDK
|
|
6
|
+
|
|
7
|
+
OpenClaw, Hermes, Codex CLI, and Claude Code share the versioned runtime
|
|
8
|
+
contract in `lib/runtime-adapter-sdk.mjs`. Start without credentials or network
|
|
9
|
+
access with `npm run demo:adapter`, then verify every runtime using
|
|
10
|
+
`npm run check:adapters`. See [docs/runtime-adapter-sdk.md](docs/runtime-adapter-sdk.md)
|
|
11
|
+
for the contract, compatibility matrix, migration, and extension guide.
|
|
12
|
+
|
|
3
13
|
## 0.13 production trust
|
|
4
14
|
|
|
5
15
|
The local production-trust contract, runtime adapter v1, durable journal,
|
|
@@ -7,7 +17,11 @@ multi-worker canary, non-destructive Ironman upgrade planner, safe demo and
|
|
|
7
17
|
unified acceptance are documented in
|
|
8
18
|
[docs/production-trust-contract.md](docs/production-trust-contract.md). Run
|
|
9
19
|
`npm run check:production-trust`; external publishing and deployment remain
|
|
10
|
-
separately authorized actions.
|
|
20
|
+
separately authorized actions. The command writes integrity-sealed evidence and
|
|
21
|
+
a redacted public summary to `.production-evidence/`. The default canary is
|
|
22
|
+
offline and fixture-only: it performs no model call or external side effect.
|
|
23
|
+
Copy `templates/github-production-trust.yml` into `.github/workflows/` only
|
|
24
|
+
when publication is separately approved.
|
|
11
25
|
|
|
12
26
|
## Read-only operator dashboard (P3)
|
|
13
27
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"project": "P2 platform-neutral runtime adapter SDK",
|
|
4
|
+
"terminal_acceptance": [
|
|
5
|
+
"versioned platform-neutral contract",
|
|
6
|
+
"OpenClaw Hermes Codex CLI and Claude Code reproducible paths",
|
|
7
|
+
"unified capability session run step effect gate continuation telemetry and errors",
|
|
8
|
+
"compatibility matrix conformance migration and extension docs",
|
|
9
|
+
"credential-free demo and read-only dashboard path",
|
|
10
|
+
"redaction fail-closed 0.13 P0 P1 regression package and clean-install evidence"
|
|
11
|
+
],
|
|
12
|
+
"backlog": [
|
|
13
|
+
{"id":"P2-1","status":"done","evidence":"lib/runtime-adapter-sdk.mjs"},
|
|
14
|
+
{"id":"P2-2","status":"done","evidence":"scripts/runtime-adapter-conformance.mjs"},
|
|
15
|
+
{"id":"P2-3","status":"done","evidence":"docs/runtime-adapter-sdk.md"},
|
|
16
|
+
{"id":"P2-4","status":"done","evidence":"examples/adapter-sdk-demo.mjs"},
|
|
17
|
+
{"id":"P2-5","status":"done","evidence":"npm run check; npm pack --pack-destination; clean npm install and packaged conformance"}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version":
|
|
3
|
-
"project": "
|
|
2
|
+
"version": 3,
|
|
3
|
+
"project": "p1-production-trust-evidence",
|
|
4
4
|
"terminal_contract": "production-trust-contract.md",
|
|
5
|
+
"milestone_completion_is_project_completion": false,
|
|
5
6
|
"items": [
|
|
6
|
-
{"id":"
|
|
7
|
-
{"id":"
|
|
8
|
-
{"id":"
|
|
9
|
-
{"id":"
|
|
10
|
-
{"id":"
|
|
11
|
-
{"id":"
|
|
7
|
+
{"id":"P1-1","outcome":"schema-versioned evidence, public summary, integrity and redaction","evidence":["lib/production-evidence.mjs","templates/production-evidence.schema.json","scripts/production-evidence-self-test.mjs"],"required":true},
|
|
8
|
+
{"id":"P1-2","outcome":"ledger-backed multi-agent soak and kill/restart chaos","evidence":["scripts/production-soak.mjs","lib/execution-ledger.mjs"],"required":true},
|
|
9
|
+
{"id":"P1-3","outcome":"claim lease handoff parked gate and stale-fence rejection","evidence":["scripts/production-soak.mjs",".production-evidence/evidence.json"],"required":true},
|
|
10
|
+
{"id":"P1-4","outcome":"unknown outcome crash boundaries and accepted-before-settle reconciliation","evidence":["scripts/production-soak.mjs","lib/execution-ledger.mjs"],"required":true},
|
|
11
|
+
{"id":"P1-5","outcome":"step replay resume divergence and zero duplicate effects","evidence":["scripts/production-soak.mjs","scripts/execution-ledger-self-test.mjs"],"required":true},
|
|
12
|
+
{"id":"P1-6","outcome":"baseline trend threshold attribution recovery cost and error metrics","evidence":["lib/production-evidence.mjs","scripts/production-evidence-self-test.mjs"],"required":true},
|
|
13
|
+
{"id":"P1-7","outcome":"OpenClaw Hermes and custom adapter compatibility matrix","evidence":["lib/runtime-adapter-v1.mjs","scripts/production-soak.mjs"],"required":true},
|
|
14
|
+
{"id":"P1-8","outcome":"GitHub CI candidate badge doctor and dashboard projection","evidence":["templates/github-production-trust.yml","README.md","lib/core.mjs","lib/operator-dashboard.mjs"],"required":true},
|
|
15
|
+
{"id":"P1-9","outcome":"offline determinism privacy and tamper negative tests","evidence":["scripts/production-evidence-self-test.mjs","scripts/production-soak.mjs"],"required":true},
|
|
16
|
+
{"id":"P1-10","outcome":"full regression package content and clean-install acceptance","evidence":["package.json","scripts/production-acceptance.mjs"],"required":true}
|
|
12
17
|
]
|
|
13
18
|
}
|
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
# Production
|
|
2
|
-
|
|
3
|
-
Status: local release candidate.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- Distributed database/HA: not provided by the local journal backend.
|
|
1
|
+
# P1 Production-Trust Evidence Terminal Contract
|
|
2
|
+
|
|
3
|
+
Status: local release candidate. Project completion requires every required P1
|
|
4
|
+
backlog item to have repeatable evidence; a scenario or milestone alone is not
|
|
5
|
+
project completion. Push, publication, deployment, production credentials,
|
|
6
|
+
real paid calls, production process control, and external effects are excluded.
|
|
7
|
+
|
|
8
|
+
## Terminal outcome
|
|
9
|
+
|
|
10
|
+
P1 turns the P0 schema-v2 execution ledger and effect protocol into a sustainable
|
|
11
|
+
production-trust evidence system. CI/canary runs emit schema-versioned,
|
|
12
|
+
integrity-sealed evidence plus a secret-redacted public summary. Baselines,
|
|
13
|
+
trends, explicit thresholds, failure attribution, runtime compatibility, cost,
|
|
14
|
+
error rate, and recovery time remain independently reviewable.
|
|
15
|
+
|
|
16
|
+
## Required acceptance
|
|
17
|
+
|
|
18
|
+
1. The deterministic multi-agent canary exercises long soak, exclusive claim,
|
|
19
|
+
lease expiry, kill/restart handoff, stale fencing, parked gate, crash before
|
|
20
|
+
and after submit, accepted-before-local-settle, reconciliation, checkpoint
|
|
21
|
+
resume, reusable replay, and replay divergence through the P0 ledger/effect
|
|
22
|
+
protocol. It does not maintain a second execution state store.
|
|
23
|
+
2. Duplicate settled effects and accepted stale fences are exactly zero;
|
|
24
|
+
unreconciled unknown outcomes are zero at terminal acceptance. Recovery time,
|
|
25
|
+
error rate, model calls, and paid-call cost meet recorded thresholds.
|
|
26
|
+
3. OpenClaw, Hermes, and custom runtime-adapter fixtures pass contract v1 using
|
|
27
|
+
simulated I/O. The boundary is explicit: fixtures prove adapter compatibility,
|
|
28
|
+
not availability of a real gateway or provider.
|
|
29
|
+
4. Evidence schema v1 supports baselines and metric deltas, threshold failures
|
|
30
|
+
with attribution, SHA-256 tamper detection, credential-shaped field redaction,
|
|
31
|
+
and a minimized public summary. Offline reruns require no network or secret.
|
|
32
|
+
5. GitHub CI template/artifact upload and badge markup are release candidates;
|
|
33
|
+
no workflow is published in this local task. Doctor and dashboard project the
|
|
34
|
+
latest evidence state without mutating it.
|
|
35
|
+
6. Full regression, package dry-run, package content inspection, and clean local
|
|
36
|
+
install pass. The packaged candidate includes schema, CI template, library,
|
|
37
|
+
canary, tests, docs, and backlog.
|
|
38
|
+
|
|
39
|
+
## Real/simulated boundary and deferred canary
|
|
40
|
+
|
|
41
|
+
`production-soak.mjs` is the authoritative offline CI canary. The separate
|
|
42
|
+
`live-runtime-soak.mjs` may perform runtime probes and is not invoked by release
|
|
43
|
+
acceptance. A real long-duration OpenClaw/Hermes run, production credentials,
|
|
44
|
+
paid inference, or external side effect needs a separate human authorization and
|
|
45
|
+
must produce a successor evidence artifact clearly labeled `real_runtime`.
|
|
46
|
+
|
|
47
|
+
## Trust limits
|
|
48
|
+
|
|
49
|
+
SHA-256 detects later artifact changes but is not an external timestamp or
|
|
50
|
+
signature. Local filesystem leases provide single-host coordination, not
|
|
51
|
+
distributed consensus or Byzantine-worker protection. Exactly-once effects still
|
|
52
|
+
depend on an upstream idempotency/reconciliation API. Unknown outcomes lacking
|
|
53
|
+
authoritative evidence fail closed and remain reconciliation debt.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Runtime Adapter SDK v1
|
|
2
|
+
|
|
3
|
+
`lib/runtime-adapter-sdk.mjs` is the platform-neutral contract. Contract id is
|
|
4
|
+
`loop.runtime-adapter`, semantic version `1.0.0`; consumers must reject unknown
|
|
5
|
+
major versions. The SDK normalizes capabilities, session/run identity, step
|
|
6
|
+
ledger events, authorized effects, human gates, heartbeat/continuation,
|
|
7
|
+
redacted evidence/telemetry, and stable `AdapterError` codes.
|
|
8
|
+
|
|
9
|
+
## Ten-minute, credential-free path
|
|
10
|
+
|
|
11
|
+
From this package, run `npm run demo:adapter`, `npm run check:adapters`, then
|
|
12
|
+
`npm run check`. All four paths use the same in-memory transport and make no
|
|
13
|
+
network calls. The existing dashboard remains a read-only projection; the demo
|
|
14
|
+
prints the command for opening it against a local workspace.
|
|
15
|
+
|
|
16
|
+
## Runtime paths
|
|
17
|
+
|
|
18
|
+
| Runtime | Factory | Integration transport |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| OpenClaw | `createOpenClawAdapter` | map invoke to trusted session/task tools |
|
|
21
|
+
| Hermes | `createHermesAdapter` | map invoke to Hermes run lifecycle |
|
|
22
|
+
| Codex CLI | `createCodexCliAdapter` | map invoke to local Codex exec/resume |
|
|
23
|
+
| Claude Code | `createClaudeCodeAdapter` | map invoke to local Claude session/resume |
|
|
24
|
+
|
|
25
|
+
Each transport implements `invoke(operation, payload)`. Operations are
|
|
26
|
+
`run.start`, `run.heartbeat`, and `run.continue`. Side effects never pass through
|
|
27
|
+
that generic transport: call `prepareEffect` first, persist its idempotency key
|
|
28
|
+
in the P0/P1 ledger, obtain explicit authorization, then submit through the
|
|
29
|
+
product-specific effect adapter. Missing authorization fails closed.
|
|
30
|
+
|
|
31
|
+
## Compatibility and migration
|
|
32
|
+
|
|
33
|
+
| Surface | Status |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| package 0.13 / P0 / P1 ledgers | compatible; unchanged |
|
|
36
|
+
| `runtime-adapter-v1.mjs` OpenClaw/Hermes/custom fixtures | retained |
|
|
37
|
+
| SDK v1 four-runtime contract | additive and preferred |
|
|
38
|
+
| future SDK major | rejected until explicitly supported |
|
|
39
|
+
|
|
40
|
+
Migrate by replacing fixture imports with a `create*Adapter(transport)` factory,
|
|
41
|
+
creating a session then run, recording every step, and routing effects through
|
|
42
|
+
`prepareEffect`. Convert caught errors using `AdapterError.toJSON()`; never log
|
|
43
|
+
raw credentials. To extend, add a runtime to `RUNTIMES`, a thin factory, and run
|
|
44
|
+
the exported conformance function with an offline transport before connecting a
|
|
45
|
+
real runtime.
|
|
46
|
+
|
|
47
|
+
Error codes are `INVALID_INPUT`, `UNSUPPORTED_CONTRACT`,
|
|
48
|
+
`UNSUPPORTED_VERSION`, `UNSUPPORTED_RUNTIME`, `INVALID_ADAPTER`,
|
|
49
|
+
`INVALID_STEP_STATE`, `EFFECT_KEY_REQUIRED`, `EFFECT_NOT_AUTHORIZED`,
|
|
50
|
+
`INVALID_GATE_DECISION`, and retryable `TRANSPORT_FAILURE`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createMemoryTransport, createOpenClawAdapter } from '../lib/runtime-adapter-sdk.mjs';
|
|
2
|
+
|
|
3
|
+
const adapter = createOpenClawAdapter(createMemoryTransport());
|
|
4
|
+
const session = await adapter.createSession({ key: 'ten-minute-demo' });
|
|
5
|
+
const run = await adapter.startRun({ sessionId: session.sessionId, requestId: 'demo', input: { prompt: 'credential-free' } });
|
|
6
|
+
await adapter.recordStep({ runId: run.runId, stepId: 'hello', evidence: [{ kind: 'local-demo' }] });
|
|
7
|
+
const heartbeat = await adapter.heartbeat({ runId: run.runId });
|
|
8
|
+
await adapter.continueRun({ runId: run.runId, continuationToken: heartbeat.continuationToken });
|
|
9
|
+
console.log(JSON.stringify({ session, run, heartbeat, dashboard: 'run `loop-engineering dashboard --root .` for the existing read-only projection', telemetry: adapter.telemetry }, null, 2));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"queue": "code-tasks",
|
|
3
|
+
"description": "L2 assisted code task queue. Each task runs in an isolated git worktree and records verification plus diff summaries. It never pushes, merges, or deletes worktrees.",
|
|
4
|
+
"dispatcher": "node scripts/dispatch-code-task.mjs",
|
|
5
|
+
"preflightConfig": "configs/loops/workspace-health.json",
|
|
6
|
+
"timeoutMs": 1800000,
|
|
7
|
+
"leaseMs": 1860000,
|
|
8
|
+
"staleActiveMs": 3600000,
|
|
9
|
+
"retry": {
|
|
10
|
+
"maxAttempts": 1,
|
|
11
|
+
"retryDelayMs": 0,
|
|
12
|
+
"retryExitCodes": [
|
|
13
|
+
1
|
|
14
|
+
],
|
|
15
|
+
"requiresHumanActionPatterns": [
|
|
16
|
+
"INSTALL_FAILED_USER_RESTRICTED",
|
|
17
|
+
"device unauthorized",
|
|
18
|
+
"no devices/emulators found",
|
|
19
|
+
"Permission denied",
|
|
20
|
+
"Operation not permitted",
|
|
21
|
+
"requires human",
|
|
22
|
+
"需要人工",
|
|
23
|
+
"权限未开"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"worktree": {
|
|
27
|
+
"enabled": true,
|
|
28
|
+
"baseDir": "runtime/loops/code-tasks/worktrees",
|
|
29
|
+
"branchPrefix": "loop/code-tasks",
|
|
30
|
+
"verifyCommands": [
|
|
31
|
+
"npm test"
|
|
32
|
+
],
|
|
33
|
+
"keepOnSuccess": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"queue": "agent-tasks",
|
|
3
|
+
"description": "Generic queue runner config. Keep dispatcher local to the target workspace.",
|
|
4
|
+
"dispatcher": "node scripts/dispatch-task.mjs",
|
|
5
|
+
"preflightConfig": "configs/loops/workspace-health.json",
|
|
6
|
+
"timeoutMs": 1800000,
|
|
7
|
+
"leaseMs": 1860000,
|
|
8
|
+
"staleActiveMs": 3600000,
|
|
9
|
+
"scheduler": {
|
|
10
|
+
"initialInterval": "10m",
|
|
11
|
+
"minInterval": "1m",
|
|
12
|
+
"maxInterval": "4h",
|
|
13
|
+
"speedupFactor": 0.5,
|
|
14
|
+
"backoffFactor": 2,
|
|
15
|
+
"idleBackoffFactor": 2,
|
|
16
|
+
"humanGateBackoffFactor": 3,
|
|
17
|
+
"longRunHeadroomFactor": 1.25,
|
|
18
|
+
"jitter": "30s"
|
|
19
|
+
},
|
|
20
|
+
"retry": {
|
|
21
|
+
"maxAttempts": 1,
|
|
22
|
+
"retryDelayMs": 0,
|
|
23
|
+
"retryExitCodes": [
|
|
24
|
+
1
|
|
25
|
+
],
|
|
26
|
+
"requiresHumanActionPatterns": [
|
|
27
|
+
"INSTALL_FAILED_USER_RESTRICTED",
|
|
28
|
+
"device unauthorized",
|
|
29
|
+
"no devices/emulators found",
|
|
30
|
+
"Permission denied",
|
|
31
|
+
"Operation not permitted",
|
|
32
|
+
"requires human",
|
|
33
|
+
"需要人工",
|
|
34
|
+
"权限未开"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { customAdapterExample } from '../lib/runtime-adapter-v1.mjs';
|
|
2
|
+
const audit = [];
|
|
3
|
+
const io = { invoke: async (binary, args) => (audit.push({ binary, args, externalWrite: false, paid: false }), { accepted: true }), now: () => new Date().toISOString(), lookup: async () => ({ status: 'not_accepted' }) };
|
|
4
|
+
await customAdapterExample.dispatch({ prompt: 'credential-free local canary', worker: 'demo' }, io);
|
|
5
|
+
console.log(JSON.stringify({ support: 'example-contract-only', credentialsUsed: false, externalWrites: false, paidCalls: false, audit }, null, 2));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "workspace-health",
|
|
3
|
+
"goal": "Keep this workspace loop-ready and detect obvious drift.",
|
|
4
|
+
"level": "L1",
|
|
5
|
+
"mode": "report-only",
|
|
6
|
+
"maxRuntimeMs": 120000,
|
|
7
|
+
"description": "A safe first loop: local read-only checks plus durable run ledger.",
|
|
8
|
+
"humanGates": [
|
|
9
|
+
"source edits",
|
|
10
|
+
"external messages",
|
|
11
|
+
"destructive commands",
|
|
12
|
+
"production config changes"
|
|
13
|
+
],
|
|
14
|
+
"breaker": {
|
|
15
|
+
"maxConsecutiveFailures": 3,
|
|
16
|
+
"sameFailureThreshold": 2
|
|
17
|
+
},
|
|
18
|
+
"checks": [
|
|
19
|
+
{
|
|
20
|
+
"id": "git-status",
|
|
21
|
+
"type": "command",
|
|
22
|
+
"cmd": "git status --short",
|
|
23
|
+
"expectExitCode": 0,
|
|
24
|
+
"timeoutMs": 10000,
|
|
25
|
+
"allowNonEmptyOutput": true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "loop-config-dir",
|
|
29
|
+
"type": "files",
|
|
30
|
+
"paths": [
|
|
31
|
+
"configs/loops"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
+
import { migrateActionReservation } from './execution-ledger.mjs';
|
|
4
5
|
|
|
5
6
|
const ACTION_KINDS = new Set(['paid_api', 'notification', 'deployment', 'process_control', 'publication', 'external_message', 'gated_mutation']);
|
|
6
7
|
const TERMINAL_STATES = new Set(['settled', 'released']);
|
|
@@ -194,3 +195,9 @@ export async function migrateLegacyActionArtifact(root, legacy) {
|
|
|
194
195
|
const scope = legacy.authorization_scope ?? legacy.authorization?.scope ?? 'legacy:unscoped';
|
|
195
196
|
return reserveAction(root, { idempotencyKey: key, kind: legacy.kind ?? 'gated_mutation', request, authorizationScope: scope });
|
|
196
197
|
}
|
|
198
|
+
|
|
199
|
+
export async function projectActionToEffectProtocol(root, idempotencyKey) {
|
|
200
|
+
const reservation = await inspectAction(root, idempotencyKey);
|
|
201
|
+
if (!reservation) throw new Error('Action reservation not found.');
|
|
202
|
+
return migrateActionReservation(root, reservation);
|
|
203
|
+
}
|