patchwork-os 1.1.0-beta.4.canary.482 → 1.1.0-beta.4.canary.484

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchwork-os",
3
- "version": "1.1.0-beta.4.canary.482",
3
+ "version": "1.1.0-beta.4.canary.484",
4
4
  "description": "Your personal AI runtime, local-first. Patchwork OS gives any AI model a consistent set of tools, YAML recipes, a delegation policy with approval queue, and a durable trace memory — all on your machine, all under your policy.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,47 +0,0 @@
1
- /**
2
- * The control boundary for a live worker — composition, not policy.
3
- *
4
- * `previewActions` answers "what would the gate say about these candidates?"
5
- * given a worker and its trust store. This resolves those two from a recipe
6
- * name, so a caller with nothing but "release-notes" can render the boundary.
7
- *
8
- * It reuses `loadWorkerTrustForRecipe` — the same resolution the live gate
9
- * performs in `buildWorkerAutonomyGate`. That matters for the same reason
10
- * `previewActions` reuses `decideWorkerAction`: if the preview resolved trust
11
- * its own way, it could show a boundary computed from a different worker
12
- * manifest or a staler store than the one enforcement will use, and be
13
- * confidently wrong. Every layer of this screen has to be a view of the gate.
14
- *
15
- * Returns null when no worker owns the recipe — the honest answer, and
16
- * distinguishable from "a worker that may do nothing", which is an empty
17
- * boundary rather than a missing one.
18
- */
19
- import type { ForbidRule } from "./forbidPolicy.js";
20
- import { type ActionBoundary, type CandidateAction } from "./previewActions.js";
21
- import type { RunWorkerShadowOpts } from "./runWorkerShadow.js";
22
- export interface WorkerBoundary {
23
- workerId: string;
24
- workerName: string;
25
- recipeName: string;
26
- boundary: ActionBoundary;
27
- /**
28
- * False when the worker-autonomy flag is off. The boundary is still computed
29
- * and still correct as a statement of policy — but nothing is enforcing it,
30
- * and a screen that does not say so would imply protection that is not
31
- * running. The caller must surface this.
32
- */
33
- enforced: boolean;
34
- }
35
- export interface BoundaryPreviewOpts {
36
- /** Caller-supplied candidates. Omitted ⇒ derived from the worker's `owns`. */
37
- candidates?: readonly CandidateAction[];
38
- forbidRules?: readonly ForbidRule[];
39
- trustOpts?: RunWorkerShadowOpts;
40
- }
41
- /**
42
- * Compute the control boundary for whichever worker owns `recipeName`.
43
- *
44
- * Read-only: resolves trust, evaluates hypotheticals, writes nothing. No
45
- * approval is enqueued and no decision is recorded — see `previewActions`.
46
- */
47
- export declare function boundaryForRecipe(recipeName: string, opts?: BoundaryPreviewOpts): WorkerBoundary | null;
@@ -1,48 +0,0 @@
1
- /**
2
- * The control boundary for a live worker — composition, not policy.
3
- *
4
- * `previewActions` answers "what would the gate say about these candidates?"
5
- * given a worker and its trust store. This resolves those two from a recipe
6
- * name, so a caller with nothing but "release-notes" can render the boundary.
7
- *
8
- * It reuses `loadWorkerTrustForRecipe` — the same resolution the live gate
9
- * performs in `buildWorkerAutonomyGate`. That matters for the same reason
10
- * `previewActions` reuses `decideWorkerAction`: if the preview resolved trust
11
- * its own way, it could show a boundary computed from a different worker
12
- * manifest or a staler store than the one enforcement will use, and be
13
- * confidently wrong. Every layer of this screen has to be a view of the gate.
14
- *
15
- * Returns null when no worker owns the recipe — the honest answer, and
16
- * distinguishable from "a worker that may do nothing", which is an empty
17
- * boundary rather than a missing one.
18
- */
19
- import { FLAG_WORKER_AUTONOMY, isEnabled } from "../featureFlags.js";
20
- import { defaultCandidatesFor, previewActions, } from "./previewActions.js";
21
- import { loadWorkerTrustForRecipe } from "./runWorkerShadow.js";
22
- /**
23
- * Compute the control boundary for whichever worker owns `recipeName`.
24
- *
25
- * Read-only: resolves trust, evaluates hypotheticals, writes nothing. No
26
- * approval is enqueued and no decision is recorded — see `previewActions`.
27
- */
28
- export function boundaryForRecipe(recipeName, opts = {}) {
29
- const trust = loadWorkerTrustForRecipe(recipeName, opts.trustOpts);
30
- if (!trust)
31
- return null;
32
- const { worker, store } = trust;
33
- const candidates = opts.candidates ?? defaultCandidatesFor(worker);
34
- return {
35
- workerId: worker.id,
36
- workerName: worker.name,
37
- recipeName,
38
- boundary: previewActions(worker, candidates, store, {
39
- ...(opts.forbidRules ? { forbidRules: opts.forbidRules } : {}),
40
- }),
41
- // Deliberately reported rather than used to suppress the result. An
42
- // operator asking "what may this worker do?" while the flag is off should
43
- // get the answer AND be told it is not being enforced — hiding the boundary
44
- // would leave them with no information at all, which is worse.
45
- enforced: isEnabled(FLAG_WORKER_AUTONOMY),
46
- };
47
- }
48
- //# sourceMappingURL=boundaryPreview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boundaryPreview.js","sourceRoot":"","sources":["../../src/workers/boundaryPreview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAGL,oBAAoB,EACpB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAuBhE;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAAkB,EAClB,OAA4B,EAAE;IAE9B,MAAM,KAAK,GAAG,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACnE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAEnE,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnB,UAAU,EAAE,MAAM,CAAC,IAAI;QACvB,UAAU;QACV,QAAQ,EAAE,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE;YAClD,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/D,CAAC;QACF,oEAAoE;QACpE,0EAA0E;QAC1E,4EAA4E;QAC5E,+DAA+D;QAC/D,QAAQ,EAAE,SAAS,CAAC,oBAAoB,CAAC;KAC1C,CAAC;AACJ,CAAC"}