owenloop 0.5.8 → 0.5.10
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 +69 -0
- package/README.md +81 -39
- package/bin/owenloop.mjs +16 -1
- package/dist/packages/work/src/agent/loop.d.ts +23 -8
- package/dist/packages/work/src/agent/loop.js +55 -6
- package/dist/packages/work/src/bundle/pull.d.ts +21 -0
- package/dist/packages/work/src/bundle/pull.js +118 -0
- package/dist/packages/work/src/consumed-verifier.js +6 -17
- package/dist/packages/work/src/exec/instructions.d.ts +4 -1
- package/dist/packages/work/src/exec/instructions.js +3 -0
- package/dist/packages/work/src/exec/loop.d.ts +2 -2
- package/dist/packages/work/src/exec/loop.js +273 -46
- package/dist/packages/work/src/exec/receipt.d.ts +7 -7
- package/dist/packages/work/src/exec/receipt.js +6 -6
- package/dist/packages/work/src/harness/claude.js +116 -0
- package/dist/packages/work/src/harness/codex.d.ts +8 -0
- package/dist/packages/work/src/harness/codex.js +27 -1
- package/dist/packages/work/src/harness/contract.d.ts +9 -0
- package/dist/packages/work/src/hub/client.d.ts +19 -4
- package/dist/packages/work/src/hub/client.js +7 -3
- package/dist/packages/work/src/hub/types.d.ts +84 -0
- package/dist/packages/work/src/main.js +1 -0
- package/dist/packages/work/src/roles/agent-run.js +57 -32
- package/dist/packages/work/src/roles/exec.js +27 -8
- package/dist/packages/work/src/roles/settings.js +2 -0
- package/dist/packages/work/src/roles/shift.js +14 -2
- package/dist/packages/work/src/roles/util.d.ts +1 -0
- package/dist/packages/work/src/roles/util.js +10 -0
- package/dist/packages/work/src/settings/hub-roster-cache.d.ts +68 -0
- package/dist/packages/work/src/settings/hub-roster-cache.js +370 -0
- package/dist/packages/work/src/settings/roster.d.ts +84 -0
- package/dist/packages/work/src/settings/roster.js +364 -5
- package/dist/packages/work/src/settings/serving.d.ts +17 -0
- package/dist/packages/work/src/settings/serving.js +79 -0
- package/dist/packages/work/src/settings/settings.d.ts +14 -1
- package/dist/packages/work/src/settings/settings.js +14 -0
- package/dist/packages/work/src/shift/loop.d.ts +108 -5
- package/dist/packages/work/src/shift/loop.js +416 -54
- package/dist/packages/work/src/shift/protocol.d.ts +7 -5
- package/dist/packages/work/src/shift/runtime.d.ts +18 -0
- package/dist/packages/work/src/shift/runtime.js +104 -5
- package/dist/packages/work/src/shift/server.js +2 -0
- package/dist/packages/work/src/shift/spawn.d.ts +17 -2
- package/dist/packages/work/src/shift/spawn.js +16 -13
- package/dist/packages/work/src/shift/state.d.ts +29 -2
- package/dist/packages/work/src/shift/state.js +45 -15
- package/dist/packages/work/src/submit-proof.d.ts +11 -8
- package/dist/packages/work/src/submit-proof.js +11 -8
- package/dist/packages/work/src/usage.d.ts +1 -1
- package/dist/packages/work/src/usage.js +7 -1
- package/dist/packages/work/src/util/modifier-init.d.ts +7 -0
- package/dist/packages/work/src/util/modifier-init.js +73 -0
- package/dist/src/bundle/tar.d.ts +9 -4
- package/dist/src/bundle/tar.js +9 -4
- package/dist/src/capabilities.d.ts +76 -6
- package/dist/src/capabilities.js +49 -6
- package/dist/src/capability-mapping-client.d.ts +29 -0
- package/dist/src/capability-mapping-client.js +160 -0
- package/dist/src/cli.d.ts +16 -3
- package/dist/src/cli.js +1925 -281
- package/dist/src/config-dir.d.ts +1 -1
- package/dist/src/config-dir.js +1 -1
- package/dist/src/crypto/index.d.ts +1 -1
- package/dist/src/crypto/index.js +1 -1
- package/dist/src/crypto/org-root.d.ts +30 -12
- package/dist/src/crypto/org-root.js +162 -14
- package/dist/src/crypto/records.d.ts +2 -0
- package/dist/src/crypto/records.js +2 -0
- package/dist/src/defs.d.ts +38 -2
- package/dist/src/defs.js +593 -86
- package/dist/src/engine.d.ts +103 -25
- package/dist/src/engine.js +331 -79
- package/dist/src/hub.d.ts +77 -0
- package/dist/src/hub.js +162 -0
- package/dist/src/implements.d.ts +56 -0
- package/dist/src/implements.js +790 -0
- package/dist/src/index.d.ts +11 -9
- package/dist/src/index.js +6 -5
- package/dist/src/mcp/serve.d.ts +22 -0
- package/dist/src/mcp/serve.js +330 -41
- package/dist/src/mcp/server.d.ts +10 -7
- package/dist/src/mcp/server.js +53 -8
- package/dist/src/model.d.ts +48 -10
- package/dist/src/model.js +252 -99
- package/dist/src/order-resolver.d.ts +1 -0
- package/dist/src/order-resolver.js +8 -1
- package/dist/src/schemas/index.d.ts +11 -0
- package/dist/src/schemas/order.v1.schema.json +7 -1
- package/dist/src/store/def-source.d.ts +19 -0
- package/dist/src/store/def-source.js +87 -17
- package/dist/src/store/gc-recovery.d.ts +46 -0
- package/dist/src/store/gc-recovery.js +258 -0
- package/dist/src/store/gc.d.ts +94 -0
- package/dist/src/store/gc.js +562 -0
- package/dist/src/store/index.d.ts +3 -1
- package/dist/src/store/index.js +2 -0
- package/dist/src/store/install.d.ts +34 -5
- package/dist/src/store/install.js +73 -11
- package/dist/src/store/pre-commit-verifier.js +42 -2
- package/dist/src/store/snapshot-guard.d.ts +18 -0
- package/dist/src/store/snapshot-guard.js +94 -0
- package/dist/src/store.d.ts +69 -4
- package/dist/src/store.js +254 -16
- package/dist/src/types.d.ts +101 -20
- package/dist/src/util.js +4 -1
- package/docs/authoring.md +235 -10
- package/docs/bundles.md +45 -2
- package/docs/cli.md +437 -55
- package/docs/crypto.md +32 -10
- package/docs/design.md +177 -47
- package/docs/evals/mcp-charter-baseline.json +428 -0
- package/docs/mcp-charter-eval.md +124 -0
- package/docs/routing.md +189 -34
- package/docs/shift-logs.md +38 -9
- package/docs/wire-contracts.md +78 -14
- package/examples/workflows/compile-dev-playbook.yaml +1 -1
- package/examples/workflows/delivery.yaml +31 -14
- package/examples/workflows/ship.yaml +38 -4
- package/package.json +2 -1
- package/plugins/claude-code/plugin/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/plugin/.mcp.json +1 -1
- package/plugins/claude-code/plugin/skills/author/SKILL.md +22 -0
- package/plugins/claude-code/plugin/skills/ephemeral/SKILL.md +95 -0
- package/plugins/claude-code/plugin/skills/graduate/SKILL.md +156 -0
- package/plugins/claude-code/plugin/skills/plan/SKILL.md +236 -0
- package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +1 -1
- package/plugins/codex/plugins/owenloop/.mcp.json +1 -1
- package/plugins/codex/plugins/owenloop/skills/author/SKILL.md +22 -0
- package/plugins/codex/plugins/owenloop/skills/ephemeral/SKILL.md +95 -0
- package/plugins/codex/plugins/owenloop/skills/graduate/SKILL.md +156 -0
- package/plugins/codex/plugins/owenloop/skills/plan/SKILL.md +236 -0
package/dist/src/engine.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { WorkflowStatus } from './model.ts';
|
|
13
13
|
import type { SchemaIssue } from './schema.ts';
|
|
14
|
-
import type { CapabilityRewrites } from './capabilities.ts';
|
|
14
|
+
import type { CapabilityMappings, CapabilityRewrites, CrewStamps } from './capabilities.ts';
|
|
15
15
|
import type { MatchMode } from './capabilities.ts';
|
|
16
16
|
import type { Store } from './store.ts';
|
|
17
17
|
import type { Author, Fingerprint, Order, WorkflowDef } from './types.ts';
|
|
@@ -160,14 +160,16 @@ export interface CreateOpts {
|
|
|
160
160
|
parentPath: string;
|
|
161
161
|
};
|
|
162
162
|
/**
|
|
163
|
-
* The ONE routing modifier this instance carries
|
|
164
|
-
*
|
|
163
|
+
* The ONE routing modifier this instance carries at a time. Must be a member
|
|
164
|
+
* of the def's declared `modifiers` set — `createInstance` throws
|
|
165
165
|
* {@link ModifierRefusalError} otherwise, rather than starting a run that
|
|
166
|
-
* would compose capabilities no crew was ever bound to.
|
|
166
|
+
* would compose capabilities no crew was ever bound to. After creation, the
|
|
167
|
+
* engine may replace it only through a def-declared artifact bind during
|
|
168
|
+
* acceptance.
|
|
167
169
|
*
|
|
168
170
|
* Absent = an unmodified run: every step is offered on bare capabilities.
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
+
* An escalated re-offer carries its own target modifier per-offer without
|
|
172
|
+
* rewriting this stored value.
|
|
171
173
|
*/
|
|
172
174
|
modifier?: string;
|
|
173
175
|
}
|
|
@@ -225,7 +227,7 @@ export type EngineEvent = {
|
|
|
225
227
|
type: 'closed';
|
|
226
228
|
workflow: string;
|
|
227
229
|
run: string;
|
|
228
|
-
outcome: 'ok' | 'no_work' | 'failed' | 'skipped';
|
|
230
|
+
outcome: 'ok' | 'no_work' | 'released' | 'failed' | 'skipped';
|
|
229
231
|
} | {
|
|
230
232
|
type: 'settled';
|
|
231
233
|
workflow: string;
|
|
@@ -381,11 +383,11 @@ export declare class Engine {
|
|
|
381
383
|
*/
|
|
382
384
|
private static readonly CHILD_OUTCOME_PIN_KEY;
|
|
383
385
|
/**
|
|
384
|
-
* F4: the single
|
|
385
|
-
* calls: artifact currently resting on"
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* to pin to).
|
|
386
|
+
* F4: the single verdict-time helper that computes "what child-outcome
|
|
387
|
+
* version is this calls: artifact currently resting on" for reject
|
|
388
|
+
* propagation and human skip. STEP 6 publication reads and stamps the version
|
|
389
|
+
* from its authoritative in-transaction snapshot instead. Returns undefined
|
|
390
|
+
* if no child has ever been spawned (nothing to pin to).
|
|
389
391
|
*/
|
|
390
392
|
private childOutcomePin;
|
|
391
393
|
/**
|
|
@@ -473,7 +475,8 @@ export declare class Engine {
|
|
|
473
475
|
* Called at the top of tick (outside any tx) and as cascade-up prompt.
|
|
474
476
|
* For each calls: step: spawn the child if gate is ready and no child exists;
|
|
475
477
|
* re-attach if it exists; re-provide if parent inputs moved; machine-green
|
|
476
|
-
* the parent artifact when the child's declared output is green
|
|
478
|
+
* the parent artifact when the child's declared output is green and the
|
|
479
|
+
* whole child workflow is done.
|
|
477
480
|
*/
|
|
478
481
|
private maintainCalls;
|
|
479
482
|
/**
|
|
@@ -503,11 +506,12 @@ export declare class Engine {
|
|
|
503
506
|
/**
|
|
504
507
|
* STEP 6 re-arm as the mirror-image atomic guard. maintainCalls' optimistic
|
|
505
508
|
* pre-read decides only WHETHER to call this; the parent artifact AND the
|
|
506
|
-
* child
|
|
507
|
-
* if the parent is still green AND the child
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
* Returns true only when
|
|
509
|
+
* child definition/artifacts are re-read inside the write lock, and the
|
|
510
|
+
* re-arm happens only if the parent is still green AND either the child
|
|
511
|
+
* outcome is non-green or the whole child is unfinished in-tx. If the outcome
|
|
512
|
+
* is green and the child is done by then, this does nothing (returns false)
|
|
513
|
+
* and the next maintainCalls pass publishes normally. Returns true only when
|
|
514
|
+
* it wrote.
|
|
511
515
|
*/
|
|
512
516
|
private rearmCallsGreen;
|
|
513
517
|
/**
|
|
@@ -546,6 +550,23 @@ export declare class Engine {
|
|
|
546
550
|
* decides a mode, it only enforces the one it is handed.
|
|
547
551
|
*/
|
|
548
552
|
matchModes?: Record<string, MatchMode>;
|
|
553
|
+
/**
|
|
554
|
+
* Per-AUTHORED-capability substitution, applied BEFORE the offer composes
|
|
555
|
+
* with the modifier, so one entry covers every grade a step can be
|
|
556
|
+
* offered at. Supplied by the same caller that supplies `matchModes` and
|
|
557
|
+
* for the same reason — deciding what an authored name means in this org
|
|
558
|
+
* requires reading an install-scoped table the pure engine cannot see.
|
|
559
|
+
* Substitution is a single hop and the value is never validated; the
|
|
560
|
+
* caller resolves any chain first. See `applyCapabilityMappings`.
|
|
561
|
+
*
|
|
562
|
+
* Absent or empty is exact identity: the offer is composed from the
|
|
563
|
+
* authored list itself, byte for byte, as before this input existed.
|
|
564
|
+
*
|
|
565
|
+
* Distinct from `capabilityRewrites` below, which is keyed by the
|
|
566
|
+
* COMPOSED string and applied AFTER composition. Both may apply in one
|
|
567
|
+
* tick, in that order.
|
|
568
|
+
*/
|
|
569
|
+
capabilityMappings?: CapabilityMappings;
|
|
549
570
|
/**
|
|
550
571
|
* Per-offered-capability reroute, keyed by the COMPOSED capability the
|
|
551
572
|
* offer would otherwise carry. Supplied by the same caller that supplies
|
|
@@ -559,6 +580,12 @@ export declare class Engine {
|
|
|
559
580
|
* record still shows the grade of service that was requested.
|
|
560
581
|
*/
|
|
561
582
|
capabilityRewrites?: CapabilityRewrites;
|
|
583
|
+
/**
|
|
584
|
+
* Per-offered-capability crews matched by the caller that owns routing
|
|
585
|
+
* bindings. The pure engine cannot compute this; it stamps the supplied
|
|
586
|
+
* match result onto the order that is actually served.
|
|
587
|
+
*/
|
|
588
|
+
crewStamps?: CrewStamps;
|
|
562
589
|
}): TickResult;
|
|
563
590
|
/**
|
|
564
591
|
* The recursive tick worker. Runs this instance's own maintain → reap →
|
|
@@ -633,9 +660,11 @@ export declare class Engine {
|
|
|
633
660
|
* Per-step cadence + daily budget + parallel cap over the eligible firings.
|
|
634
661
|
*
|
|
635
662
|
* A2: `capabilities` is the tick caller's claim filter, matched against the
|
|
636
|
-
* step's OFFERED capabilities — the authored list
|
|
637
|
-
*
|
|
638
|
-
*
|
|
663
|
+
* step's OFFERED capabilities — the authored list mapped onto the caller's
|
|
664
|
+
* own capability names, composed with the modifier this firing will actually
|
|
665
|
+
* be offered under (`wise` + `deep` → `wise:deep`), then rewritten by any
|
|
666
|
+
* reroute the caller decided on, which is the same list the order will carry.
|
|
667
|
+
* `claimMatches` owns the rule;
|
|
639
668
|
* see it for the four cases (no filter presented, capability-silent step,
|
|
640
669
|
* empty caller list, both non-empty) and for what `matchModes` changes.
|
|
641
670
|
* A firing this caller may not claim is deferred as `'capability-mismatch'`.
|
|
@@ -708,6 +737,33 @@ export declare class Engine {
|
|
|
708
737
|
* the order's digest — before any caller can execute a prompt or command.
|
|
709
738
|
*/
|
|
710
739
|
resolveOrder(order: Order): ResolvedInstructions;
|
|
740
|
+
/** Return the binding declaration that owns this artifact path, if any. */
|
|
741
|
+
private artifactBind;
|
|
742
|
+
/** Resolve a declared dot-path of object keys against an accepted artifact value. */
|
|
743
|
+
private boundValue;
|
|
744
|
+
/**
|
|
745
|
+
* The bind-time and reject-time modifier gate: membership in the def's
|
|
746
|
+
* declared `modifiers` set, and nothing else — byte for byte the rule the
|
|
747
|
+
* start path applies in `createInstanceInTx`. One value cannot be legal to
|
|
748
|
+
* start a run with and illegal to bind.
|
|
749
|
+
*
|
|
750
|
+
* `def` here is the PINNED snapshot, so the vocabulary checked is the one
|
|
751
|
+
* stamped on this run, not a later republish.
|
|
752
|
+
*
|
|
753
|
+
* The SHAPE of a name is constrained where a name is authored:
|
|
754
|
+
* `parseModifiers` in `src/defs.ts` refuses an empty name, a name containing
|
|
755
|
+
* whitespace, a name containing `MODIFIER_SEPARATOR`, and a duplicate.
|
|
756
|
+
* Re-testing shape here is what split the vocabulary in the first place — a
|
|
757
|
+
* value the parser admitted and `start_run` accepted, refused at bind.
|
|
758
|
+
*/
|
|
759
|
+
private assertBoundModifier;
|
|
760
|
+
/** Validate extraction before an acceptance branch changes an artifact. */
|
|
761
|
+
private validateArtifactBind;
|
|
762
|
+
/**
|
|
763
|
+
* Persist a declared instance-routing write and its single artifact-level
|
|
764
|
+
* audit event. Call only from an already-accepted branch inside its tx.
|
|
765
|
+
*/
|
|
766
|
+
private applyArtifactBind;
|
|
711
767
|
/**
|
|
712
768
|
* Commit a singleton/map output green — or born-reject it if an input moved.
|
|
713
769
|
*
|
|
@@ -769,7 +825,7 @@ export declare class Engine {
|
|
|
769
825
|
* See `docs/design.md` §24.9 for the full writeup and operator mitigations
|
|
770
826
|
* (`parallel: 1`, a generous `reapTtl:` on slow judge steps).
|
|
771
827
|
*/
|
|
772
|
-
reject(workflow: string, path: string, by: Author, text: string): {
|
|
828
|
+
reject(workflow: string, path: string, by: Author, text: string, requested?: string): {
|
|
773
829
|
outcome: 'rejected' | 'born-rejected';
|
|
774
830
|
reason?: string;
|
|
775
831
|
};
|
|
@@ -845,7 +901,7 @@ export declare class Engine {
|
|
|
845
901
|
*/
|
|
846
902
|
retry(workflow: string, path: string, by?: Author, text?: string): void;
|
|
847
903
|
/** Close a run (audit/budget) and release its lease so the task can re-arm. */
|
|
848
|
-
close(workflow: string, run: string, outcome?: 'ok' | 'no_work' | 'failed' | 'skipped', summary?: string): void;
|
|
904
|
+
close(workflow: string, run: string, outcome?: 'ok' | 'no_work' | 'released' | 'failed' | 'skipped', summary?: string): void;
|
|
849
905
|
/**
|
|
850
906
|
* Touch the liveness timestamp on an open run's task. A run that periodically
|
|
851
907
|
* calls heartbeat() will never be falsely reaped as long as beats arrive within
|
|
@@ -926,10 +982,32 @@ export declare class Engine {
|
|
|
926
982
|
private settle;
|
|
927
983
|
private applyOp;
|
|
928
984
|
/**
|
|
929
|
-
*
|
|
985
|
+
* Re-stamp the owed version target for `path` on any OPEN claim that owes it.
|
|
986
|
+
*
|
|
987
|
+
* The target frozen at claim issue is `committed + 1`. That stays correct for
|
|
988
|
+
* every refusal that leaves the run open WITHOUT bumping the artifact (the
|
|
989
|
+
* schema reject and the artifact-bind reject in `green()`). It goes stale for
|
|
990
|
+
* a judgment/human reject, which is preceded by a commit that already bumped
|
|
991
|
+
* the artifact and which leaves the SAME claim live to retry: the next commit
|
|
992
|
+
* lands `committed + 1` from the new committed version, while the producer is
|
|
993
|
+
* still signing the old number into its proof's `produced[].version`. The
|
|
994
|
+
* proof row is then stored under a key the envelope does not name, and the
|
|
995
|
+
* consumer's version check refuses the artifact.
|
|
996
|
+
*
|
|
997
|
+
* Matching is by owed path, not by task key, so it is correct for map
|
|
998
|
+
* elements without re-deriving the binding key. Runs inside the caller's open
|
|
999
|
+
* tx (plain store writes, no nested tx).
|
|
1000
|
+
*/
|
|
1001
|
+
private restampOwedTarget;
|
|
1002
|
+
/**
|
|
1003
|
+
* §12.2 born-reject lease release: close the run (`released`) and re-arm its
|
|
930
1004
|
* task to `idle` so the firing is immediately re-claimable next tick. Runs
|
|
931
1005
|
* inside the caller's open tx (plain store write, no nested tx). Unlike reap()
|
|
932
|
-
* it does NOT bump attempts — a CAS-stale born-reject is not lease churn.
|
|
1006
|
+
* it does NOT bump attempts — a CAS-stale born-reject is not lease churn. For
|
|
1007
|
+
* the same reason the outcome is `released` and not `no_work`: the step never
|
|
1008
|
+
* ran, so the run must not spend the daily budget or restart the cadence
|
|
1009
|
+
* clock either. `no_work` is reserved for a step that DID run and had nothing
|
|
1010
|
+
* to produce, which is a firing and does spend both. The
|
|
933
1011
|
* `closed` event is fired by the caller AFTER the tx commits (post-commit
|
|
934
1012
|
* ordering), matching public close().
|
|
935
1013
|
*/
|