owenloop 0.5.32 → 0.5.34
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 +15 -0
- package/dist/packages/work/src/shift/state.js +37 -2
- package/dist/src/bundle/call-target.d.ts +9 -0
- package/dist/src/bundle/call-target.js +32 -0
- package/dist/src/bundle/error.d.ts +8 -0
- package/dist/src/bundle/error.js +11 -0
- package/dist/src/bundle/manifest.d.ts +5 -6
- package/dist/src/bundle/manifest.js +10 -30
- package/dist/src/bundle/types.d.ts +2 -11
- package/dist/src/bundle/types.js +1 -14
- package/dist/src/crypto/ssh.js +8 -4
- package/dist/src/defs.js +3 -2
- package/dist/src/engine.d.ts +5 -1
- package/dist/src/engine.js +8 -5
- package/package.json +1 -1
- package/plugins/claude-code/plugin/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/plugin/.mcp.json +1 -1
- package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +1 -1
- package/plugins/codex/plugins/owenloop/.mcp.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All notable changes to this project are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
|
|
5
5
|
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.5.34](https://github.com/typicalday/owenloop/compare/v0.5.33...v0.5.34) (2026-10-01)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* handle early SSH verifier stdin close ([bbe69ec](https://github.com/typicalday/owenloop/commit/bbe69ecd8aa8acb92e1740105dfab600c9a0b571))
|
|
13
|
+
|
|
14
|
+
## [0.5.33](https://github.com/typicalday/owenloop/compare/v0.5.32...v0.5.33) (2026-10-01)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **engine:** allow terminal tree teardown to skip parent cascade ([f9eaaea](https://github.com/typicalday/owenloop/commit/f9eaaea4ef097060ce4cc717aae5b4e0d73d8e73))
|
|
20
|
+
* **work:** publish shift reservations atomically ([2ca3025](https://github.com/typicalday/owenloop/commit/2ca302577f28fa59c0274d0cbb3719a028227b89))
|
|
21
|
+
|
|
7
22
|
## [0.5.32](https://github.com/typicalday/owenloop/compare/v0.5.31...v0.5.32) (2026-10-01)
|
|
8
23
|
|
|
9
24
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* crash after PID persistence leaves enough state for restart reconciliation to
|
|
10
10
|
* open the gate safely.
|
|
11
11
|
*/
|
|
12
|
-
import { closeSync, existsSync, fsyncSync, ftruncateSync, mkdirSync, openSync, readdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync, } from 'node:fs';
|
|
12
|
+
import { closeSync, existsSync, fsyncSync, ftruncateSync, linkSync, mkdirSync, openSync, readdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync, } from 'node:fs';
|
|
13
13
|
import { randomBytes } from 'node:crypto';
|
|
14
14
|
import { basename, join, resolve } from 'node:path';
|
|
15
15
|
export const DEFAULT_RESERVATION_MAX_AGE_MS = 2 * 60_000;
|
|
@@ -121,6 +121,41 @@ function atomicWrite(path, value) {
|
|
|
121
121
|
throw error;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
+
/** Publish a complete reservation without replacing another shift's claim. */
|
|
125
|
+
function atomicExclusiveWrite(path, value) {
|
|
126
|
+
const dir = join(path, '..');
|
|
127
|
+
mkdirSync(dir, { recursive: true });
|
|
128
|
+
const tmp = join(dir, `.${randomBytes(8).toString('hex')}-${process.pid}-${Date.now()}.tmp`);
|
|
129
|
+
try {
|
|
130
|
+
durableExclusiveWrite(tmp, value);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
try {
|
|
134
|
+
durableRemove(tmp);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// Preserve the write or sync failure; no canonical record was installed.
|
|
138
|
+
}
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
// open('wx') on the canonical path exposes an empty file before its write.
|
|
143
|
+
// A hard link installs the already-fsynced inode atomically and still
|
|
144
|
+
// refuses an existing run record instead of replacing its owner.
|
|
145
|
+
linkSync(tmp, path);
|
|
146
|
+
syncDirectory(dir);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
try {
|
|
150
|
+
durableRemove(tmp);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Preserve the install failure; a leftover temp is never a run record.
|
|
154
|
+
}
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
durableRemove(tmp);
|
|
158
|
+
}
|
|
124
159
|
function writeStateRecord(stateDir, record) {
|
|
125
160
|
atomicWrite(recordFile(stateDir, record.run), JSON.stringify(record));
|
|
126
161
|
}
|
|
@@ -146,7 +181,7 @@ export function reserveChild(stateDir, request) {
|
|
|
146
181
|
try {
|
|
147
182
|
// Exclusive create is the same-run reservation point. A stale, live, or even
|
|
148
183
|
// corrupt existing record blocks dispatch rather than being overwritten.
|
|
149
|
-
|
|
184
|
+
atomicExclusiveWrite(recordFile(stateDir, reservation.run), JSON.stringify(reservation));
|
|
150
185
|
}
|
|
151
186
|
catch (error) {
|
|
152
187
|
try {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Workflow map keys: lowercase-start, lowercase alphanumeric and hyphen. */
|
|
2
|
+
export declare const WORKFLOW_NAME_RE: RegExp;
|
|
3
|
+
/** Parse an exact call. `#` cannot occur in a store coordinate. */
|
|
4
|
+
export declare function parseVersionedCallTarget(text: string, validateCoordinate: (coordinate: string) => unknown): {
|
|
5
|
+
coordinate: string;
|
|
6
|
+
workflow?: string;
|
|
7
|
+
};
|
|
8
|
+
/** True for a well-formed exact package call, optionally selecting a named workflow. */
|
|
9
|
+
export declare function isVersionedReference(text: string, validateCoordinate: (coordinate: string) => unknown): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Exact bundle-call syntax, separate from filesystem and YAML manifest loading. */
|
|
2
|
+
import { BundleError } from "./error.js";
|
|
3
|
+
/** Workflow map keys: lowercase-start, lowercase alphanumeric and hyphen. */
|
|
4
|
+
export const WORKFLOW_NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
5
|
+
/** Historical explicit-coordinate spelling; store parsing excludes ambiguous separators. */
|
|
6
|
+
const VERSIONED_REF_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+@[!-~]+$/;
|
|
7
|
+
/** Parse an exact call. `#` cannot occur in a store coordinate. */
|
|
8
|
+
export function parseVersionedCallTarget(text, validateCoordinate) {
|
|
9
|
+
const hash = text.indexOf('#');
|
|
10
|
+
const coordinate = hash < 0 ? text : text.slice(0, hash);
|
|
11
|
+
if (!VERSIONED_REF_RE.test(coordinate)) {
|
|
12
|
+
throw new BundleError('MANIFEST_ERROR', `invalid exact versioned call target '${text}'`);
|
|
13
|
+
}
|
|
14
|
+
validateCoordinate(coordinate);
|
|
15
|
+
if (hash < 0)
|
|
16
|
+
return { coordinate };
|
|
17
|
+
const workflow = text.slice(hash + 1);
|
|
18
|
+
if (!WORKFLOW_NAME_RE.test(workflow)) {
|
|
19
|
+
throw new BundleError('MANIFEST_ERROR', `invalid named workflow selector '${text}'`);
|
|
20
|
+
}
|
|
21
|
+
return { coordinate, workflow };
|
|
22
|
+
}
|
|
23
|
+
/** True for a well-formed exact package call, optionally selecting a named workflow. */
|
|
24
|
+
export function isVersionedReference(text, validateCoordinate) {
|
|
25
|
+
try {
|
|
26
|
+
parseVersionedCallTarget(text, validateCoordinate);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Stable bundle failure codes shared by readers and the portable call parser. */
|
|
2
|
+
export type BundleErrorCode = 'BUNDLE_IO' | 'BUNDLE_NOT_GZIP' | 'BUNDLE_LIMIT' | 'ARCHIVE_TOO_MANY_ENTRIES' | 'ARCHIVE_ENTRY_TOO_LARGE' | 'ARCHIVE_PATH_TOO_LONG' | 'ARCHIVE_PATH_VIOLATION' | 'ARCHIVE_DUPLICATE_PATH' | 'ARCHIVE_PATH_PREFIX_COLLISION' | 'ARCHIVE_TRUNCATED' | 'ARCHIVE_BAD_CHECKSUM' | 'ARCHIVE_BAD_OCTAL' | 'ARCHIVE_BAD_PAX' | 'ARCHIVE_DANGLING_PAX' | 'ARCHIVE_TRAILING_BYTES' | 'UNSUPPORTED_ENTRY_TYPE' | 'NON_CANONICAL_HEADER' | 'MANIFEST_ERROR' | 'RUNTIME_INCOMPATIBLE' | 'UNSUPPORTED_FORMAT_VERSION' | 'MANIFEST_MISSING' | 'WORKFLOW_MISSING' | 'WORKFLOW_INVALID' | 'INTEGRITY_MISMATCH' | 'SOURCE_NOT_A_DIRECTORY' | 'SOURCE_NOT_A_FILE' | 'SOURCE_SYMLINK' | 'SOURCE_INVALID_PATH' | 'SOURCE_FILE_CHANGED' | 'OUTPUT_INSIDE_SOURCE' | 'OUTPUT_INVALID' | 'DESTINATION_EXISTS' | 'DESTINATION_PARENT_INVALID' | 'WORKFLOW_ERROR';
|
|
3
|
+
/** A typed bundle failure. */
|
|
4
|
+
export declare class BundleError extends Error {
|
|
5
|
+
readonly code: BundleErrorCode;
|
|
6
|
+
readonly entryPath?: string;
|
|
7
|
+
constructor(code: BundleErrorCode, message: string, entryPath?: string);
|
|
8
|
+
}
|
|
@@ -18,17 +18,16 @@
|
|
|
18
18
|
* indent, one final newline.
|
|
19
19
|
*/
|
|
20
20
|
import type { BundleManifest } from './types.ts';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** Workflow map keys: lowercase-start, lowercase alphanumeric and hyphen. */
|
|
24
|
-
export declare const WORKFLOW_NAME_RE: RegExp;
|
|
25
|
-
/** Parse an exact call. `#` cannot occur in a store coordinate, so the selector is unambiguous. */
|
|
21
|
+
export { WORKFLOW_NAME_RE } from './call-target.ts';
|
|
22
|
+
/** Parse an exact call using the store's canonical coordinate validator. */
|
|
26
23
|
export declare function parseVersionedCallTarget(text: string): {
|
|
27
24
|
coordinate: string;
|
|
28
25
|
workflow?: string;
|
|
29
26
|
};
|
|
30
|
-
/**
|
|
27
|
+
/** Preserve the manifest API's boolean check for an exact call. */
|
|
31
28
|
export declare function isVersionedReference(text: string): boolean;
|
|
29
|
+
/** Lowercase 64-hex SHA-256 of `bytes`. */
|
|
30
|
+
export declare function sha256Hex(bytes: Uint8Array): string;
|
|
32
31
|
/**
|
|
33
32
|
* Parse and validate `.wnlp` manifest bytes, fail-closed. Refuses non-UTF-8
|
|
34
33
|
* input, a missing (or double) final newline, any YAML parse error or
|
|
@@ -21,8 +21,18 @@ import { createHash } from 'node:crypto';
|
|
|
21
21
|
import { isAlias, isMap, isPair, isScalar, isSeq, parseDocument, } from 'yaml';
|
|
22
22
|
import { canonicalBundlePathViolation } from "../archive.js";
|
|
23
23
|
import { parseWorkflowCoordinate } from "../store/types.js";
|
|
24
|
+
import { isVersionedReference as isPortableVersionedReference, parseVersionedCallTarget as parsePortableVersionedCallTarget, WORKFLOW_NAME_RE, } from "./call-target.js";
|
|
24
25
|
import { assertCurrentRuntimeCompatible, isCanonicalSemver } from "./runtime.js";
|
|
25
26
|
import { BundleError } from "./types.js";
|
|
27
|
+
export { WORKFLOW_NAME_RE } from "./call-target.js";
|
|
28
|
+
/** Parse an exact call using the store's canonical coordinate validator. */
|
|
29
|
+
export function parseVersionedCallTarget(text) {
|
|
30
|
+
return parsePortableVersionedCallTarget(text, parseWorkflowCoordinate);
|
|
31
|
+
}
|
|
32
|
+
/** Preserve the manifest API's boolean check for an exact call. */
|
|
33
|
+
export function isVersionedReference(text) {
|
|
34
|
+
return isPortableVersionedReference(text, parseWorkflowCoordinate);
|
|
35
|
+
}
|
|
26
36
|
/** Lowercase 64-hex SHA-256 of `bytes`. */
|
|
27
37
|
export function sha256Hex(bytes) {
|
|
28
38
|
return createHash('sha256').update(bytes).digest('hex');
|
|
@@ -30,8 +40,6 @@ export function sha256Hex(bytes) {
|
|
|
30
40
|
const DIGEST_RE = /^[0-9a-f]{64}$/;
|
|
31
41
|
/** Portable package namespace. */
|
|
32
42
|
const PACKAGE_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
|
|
33
|
-
/** Workflow map keys: lowercase-start, lowercase alphanumeric and hyphen. */
|
|
34
|
-
export const WORKFLOW_NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
35
43
|
/** Version: printable ASCII, no separators that would break filenames or lock keys. */
|
|
36
44
|
const VERSION_RE = /^[!-~]{1,128}$/;
|
|
37
45
|
/** Versioned runtime feature identifier ending in a positive `.vN` version. */
|
|
@@ -40,34 +48,6 @@ const RUNTIME_FEATURE_RE = /^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*\.v[1-9][0-9]*$/;
|
|
|
40
48
|
const PLATFORM_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
41
49
|
/** Capability class identifier. */
|
|
42
50
|
const CAPABILITY_CLASS_RE = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/;
|
|
43
|
-
/** Historical explicit-coordinate spelling; store parsing further excludes ambiguous separators. */
|
|
44
|
-
const VERSIONED_REF_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+@[!-~]+$/;
|
|
45
|
-
/** Parse an exact call. `#` cannot occur in a store coordinate, so the selector is unambiguous. */
|
|
46
|
-
export function parseVersionedCallTarget(text) {
|
|
47
|
-
const hash = text.indexOf('#');
|
|
48
|
-
const coordinate = hash < 0 ? text : text.slice(0, hash);
|
|
49
|
-
if (!VERSIONED_REF_RE.test(coordinate)) {
|
|
50
|
-
throw new BundleError('MANIFEST_ERROR', `invalid exact versioned call target '${text}'`);
|
|
51
|
-
}
|
|
52
|
-
parseWorkflowCoordinate(coordinate);
|
|
53
|
-
if (hash < 0)
|
|
54
|
-
return { coordinate };
|
|
55
|
-
const workflow = text.slice(hash + 1);
|
|
56
|
-
if (!WORKFLOW_NAME_RE.test(workflow)) {
|
|
57
|
-
throw new BundleError('MANIFEST_ERROR', `invalid named workflow selector '${text}'`);
|
|
58
|
-
}
|
|
59
|
-
return { coordinate, workflow };
|
|
60
|
-
}
|
|
61
|
-
/** True for a well-formed exact package call, optionally selecting a named workflow. */
|
|
62
|
-
export function isVersionedReference(text) {
|
|
63
|
-
try {
|
|
64
|
-
parseVersionedCallTarget(text);
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
51
|
/**
|
|
72
52
|
* Walk a yaml AST into plain JS values, fail-closed: refuses aliases, merge
|
|
73
53
|
* keys, any tag (custom `!x` or built-in `!!x`), and non-string map keys.
|
|
@@ -6,17 +6,8 @@
|
|
|
6
6
|
* bytes. See `docs/bundles.md` for the full format contract.
|
|
7
7
|
*/
|
|
8
8
|
import type { TarLimits } from '../archive.ts';
|
|
9
|
-
|
|
10
|
-
export type BundleErrorCode
|
|
11
|
-
/**
|
|
12
|
-
* A typed bundle failure. `message` is human-readable; `entryPath` carries
|
|
13
|
-
* the offending archive/manifest entry when applicable.
|
|
14
|
-
*/
|
|
15
|
-
export declare class BundleError extends Error {
|
|
16
|
-
readonly code: BundleErrorCode;
|
|
17
|
-
readonly entryPath?: string;
|
|
18
|
-
constructor(code: BundleErrorCode, message: string, entryPath?: string);
|
|
19
|
-
}
|
|
9
|
+
export { BundleError } from './error.ts';
|
|
10
|
+
export type { BundleErrorCode } from './error.ts';
|
|
20
11
|
/** Compatibility requirements that a format-v2 bundle places on its reader/runtime. */
|
|
21
12
|
export interface BundleRuntimeRequirements {
|
|
22
13
|
/** Minimum canonical Owenloop SemVer accepted by the bundle. */
|
package/dist/src/bundle/types.js
CHANGED
|
@@ -5,17 +5,4 @@
|
|
|
5
5
|
* ("def digest") is the lowercase SHA-256 of the UNCOMPRESSED canonical tar
|
|
6
6
|
* bytes. See `docs/bundles.md` for the full format contract.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
* A typed bundle failure. `message` is human-readable; `entryPath` carries
|
|
10
|
-
* the offending archive/manifest entry when applicable.
|
|
11
|
-
*/
|
|
12
|
-
export class BundleError extends Error {
|
|
13
|
-
code;
|
|
14
|
-
entryPath;
|
|
15
|
-
constructor(code, message, entryPath) {
|
|
16
|
-
super(message);
|
|
17
|
-
this.code = code;
|
|
18
|
-
if (entryPath !== undefined)
|
|
19
|
-
this.entryPath = entryPath;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
8
|
+
export { BundleError } from "./error.js";
|
package/dist/src/crypto/ssh.js
CHANGED
|
@@ -56,6 +56,7 @@ export const defaultSshProcess = {
|
|
|
56
56
|
let errLen = 0;
|
|
57
57
|
let truncated = false;
|
|
58
58
|
let timedOut = false;
|
|
59
|
+
let stdinWriteFailed = false;
|
|
59
60
|
const cap = opts.maxBuffer ?? SSH_MAX_BUFFER;
|
|
60
61
|
const timer = setTimeout(() => {
|
|
61
62
|
timedOut = true;
|
|
@@ -73,6 +74,11 @@ export const defaultSshProcess = {
|
|
|
73
74
|
if (errLen <= cap)
|
|
74
75
|
stderr.push(c);
|
|
75
76
|
});
|
|
77
|
+
// A verifier can reject a malformed signature and close its read end
|
|
78
|
+
// before the message has drained. Consume the resulting EPIPE instead
|
|
79
|
+
// of letting an unhandled stdin error terminate the caller. A zero exit
|
|
80
|
+
// after an incomplete write must never be treated as a valid signature.
|
|
81
|
+
child.stdin.on('error', () => { stdinWriteFailed = true; });
|
|
76
82
|
child.on('error', () => {
|
|
77
83
|
clearTimeout(timer);
|
|
78
84
|
resolve({ status: null, stdout: Buffer.alloc(0), stderr: Buffer.alloc(0), timedOut: false, truncated: false });
|
|
@@ -80,16 +86,14 @@ export const defaultSshProcess = {
|
|
|
80
86
|
child.on('close', (code) => {
|
|
81
87
|
clearTimeout(timer);
|
|
82
88
|
resolve({
|
|
83
|
-
status: code,
|
|
89
|
+
status: stdinWriteFailed && code === 0 ? null : code,
|
|
84
90
|
stdout: Buffer.concat(stdout),
|
|
85
91
|
stderr: Buffer.concat(stderr),
|
|
86
92
|
timedOut,
|
|
87
93
|
truncated,
|
|
88
94
|
});
|
|
89
95
|
});
|
|
90
|
-
|
|
91
|
-
child.stdin.write(opts.stdin);
|
|
92
|
-
child.stdin.end();
|
|
96
|
+
child.stdin.end(opts.stdin && opts.stdin.length > 0 ? opts.stdin : undefined);
|
|
93
97
|
});
|
|
94
98
|
},
|
|
95
99
|
probe(cmd, args, opts) {
|
package/dist/src/defs.js
CHANGED
|
@@ -29,7 +29,8 @@ import { assertValidSchema } from "./schema.js";
|
|
|
29
29
|
// The separator lives with composition/matching (capabilities.ts); the parser
|
|
30
30
|
// only enforces that an AUTHORED name never contains it.
|
|
31
31
|
import { MODIFIER_SEPARATOR } from "./capabilities.js";
|
|
32
|
-
import { parseVersionedCallTarget } from "./bundle/
|
|
32
|
+
import { parseVersionedCallTarget } from "./bundle/call-target.js";
|
|
33
|
+
import { parseWorkflowCoordinate } from "./store/types.js";
|
|
33
34
|
import { isCallStep } from "./types.js";
|
|
34
35
|
/** Hand-maintained key allowlist for RawInput — kept next to the interface so
|
|
35
36
|
* the two can't silently drift (§27 unknown-key rejection). */
|
|
@@ -2319,7 +2320,7 @@ function resolveCallsTargetKey(defs, target, from) {
|
|
|
2319
2320
|
let lockKey = target;
|
|
2320
2321
|
if (target.includes('#')) {
|
|
2321
2322
|
try {
|
|
2322
|
-
lockKey = parseVersionedCallTarget(target).coordinate;
|
|
2323
|
+
lockKey = parseVersionedCallTarget(target, parseWorkflowCoordinate).coordinate;
|
|
2323
2324
|
}
|
|
2324
2325
|
catch {
|
|
2325
2326
|
return undefined;
|
package/dist/src/engine.d.ts
CHANGED
|
@@ -947,7 +947,11 @@ export declare class Engine {
|
|
|
947
947
|
*/
|
|
948
948
|
retry(workflow: string, path: string, by?: Author, text?: string): void;
|
|
949
949
|
/** Close a run (audit/budget) and release its lease so the task can re-arm. */
|
|
950
|
-
close(workflow: string, run: string, outcome?: 'ok' | 'no_work' | 'released' | 'failed' | 'skipped', summary?: string
|
|
950
|
+
close(workflow: string, run: string, outcome?: 'ok' | 'no_work' | 'released' | 'failed' | 'skipped', summary?: string, opts?: {
|
|
951
|
+
/** Disable the child-to-parent cascade only while terminating an entire
|
|
952
|
+
* calls tree. A live parent needs this cascade for forward progress. */
|
|
953
|
+
maintainParent?: boolean;
|
|
954
|
+
}): void;
|
|
951
955
|
/**
|
|
952
956
|
* Touch the liveness timestamp on an open run's task. A run that periodically
|
|
953
957
|
* calls heartbeat() will never be falsely reaped as long as beats arrive within
|
package/dist/src/engine.js
CHANGED
|
@@ -15,7 +15,7 @@ import { summarizeIssues, validateValue } from "./schema.js";
|
|
|
15
15
|
import { hashDef } from "./defs.js";
|
|
16
16
|
import { checkInterfaceCompatibility } from "./implements.js";
|
|
17
17
|
import { isDefDigest, parseWorkflowCoordinate } from "./store/types.js";
|
|
18
|
-
import { parseVersionedCallTarget } from "./bundle/
|
|
18
|
+
import { parseVersionedCallTarget } from "./bundle/call-target.js";
|
|
19
19
|
import { applyCapabilityMappings, applyCapabilityRewrites, claimMatches, composeCapabilities } from "./capabilities.js";
|
|
20
20
|
import { localMidnightMs, nowMs, randId } from "./util.js";
|
|
21
21
|
import { isCallStep } from "./types.js";
|
|
@@ -181,7 +181,7 @@ function hasExactImplementationClaim(def, expected) {
|
|
|
181
181
|
*/
|
|
182
182
|
function callsPinViolation(parentDef, childDef, target) {
|
|
183
183
|
if (target.includes('/')) {
|
|
184
|
-
const lockKey = target.includes('#') ? parseVersionedCallTarget(target).coordinate : target;
|
|
184
|
+
const lockKey = target.includes('#') ? parseVersionedCallTarget(target, parseWorkflowCoordinate).coordinate : target;
|
|
185
185
|
const pinned = parentDef.bundleLock?.[lockKey];
|
|
186
186
|
if (pinned === undefined) {
|
|
187
187
|
return parentDef.bundleDigest !== undefined && target.includes('#')
|
|
@@ -575,7 +575,7 @@ export class Engine {
|
|
|
575
575
|
let snapshotDef;
|
|
576
576
|
let optimisticInterfaceBinding;
|
|
577
577
|
const namedExactLockKey = step.calls !== undefined && step.calls.includes('#') && parentDef.bundleDigest !== undefined
|
|
578
|
-
? parseVersionedCallTarget(step.calls).coordinate
|
|
578
|
+
? parseVersionedCallTarget(step.calls, parseWorkflowCoordinate).coordinate
|
|
579
579
|
: undefined;
|
|
580
580
|
let verifiedParentPin;
|
|
581
581
|
// Interface targets are selected once, stored on the parent, and resolved by
|
|
@@ -2882,7 +2882,7 @@ export class Engine {
|
|
|
2882
2882
|
}
|
|
2883
2883
|
// ---- run lifecycle ---------------------------------------------------------
|
|
2884
2884
|
/** Close a run (audit/budget) and release its lease so the task can re-arm. */
|
|
2885
|
-
close(workflow, run, outcome = 'ok', summary) {
|
|
2885
|
+
close(workflow, run, outcome = 'ok', summary, opts) {
|
|
2886
2886
|
this.store.tx(() => {
|
|
2887
2887
|
const r = this.store.getRun(run);
|
|
2888
2888
|
if (!r)
|
|
@@ -2910,7 +2910,10 @@ export class Engine {
|
|
|
2910
2910
|
// forward cascade and no `settled` to derive — just the lifecycle signal.
|
|
2911
2911
|
this.fire({ type: 'closed', workflow, run, outcome });
|
|
2912
2912
|
// M2B cascade-up prompt: closing a run may advance the child's artifact state.
|
|
2913
|
-
|
|
2913
|
+
// Terminal tree cancellation closes every lease itself. Maintaining a
|
|
2914
|
+
// parent while that tree is being torn down can create new calls children.
|
|
2915
|
+
if (opts?.maintainParent !== false)
|
|
2916
|
+
this.triggerParentIfChild(workflow);
|
|
2914
2917
|
}
|
|
2915
2918
|
/**
|
|
2916
2919
|
* Touch the liveness timestamp on an open run's task. A run that periodically
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "owenloop",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.34",
|
|
4
4
|
"description": "Deterministic rails for agentic workflows. Declare steps and dependencies; the engine guarantees order, redoes what changes invalidate, and stops what keeps failing — instead of hoping the agent follows through.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "typicalday",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "owenloop",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.34",
|
|
4
4
|
"description": "Claude Code driver for owenloop — cross-harness shift and conduct skills driven by the owenloop CLI, plus one hub control-plane MCP server backing an author skill and a fallback worker, for conducting and authoring workflows against your hosted owenloop server.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Typical Day"
|