pi-fabric 0.76.2 → 0.78.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/README.md +1 -0
- package/dist/agents/bash-worktree-add.d.ts +24 -0
- package/dist/agents/bash-worktree-add.d.ts.map +1 -0
- package/dist/agents/clone-first-worktree.d.ts +17 -0
- package/dist/agents/clone-first-worktree.d.ts.map +1 -0
- package/dist/agents/cow-clone.d.ts +8 -0
- package/dist/agents/cow-clone.d.ts.map +1 -0
- package/dist/agents/worktree-manager.d.ts.map +1 -1
- package/dist/agents/worktree-paths.d.ts +5 -0
- package/dist/agents/worktree-paths.d.ts.map +1 -0
- package/dist/capture/catalog.d.ts +3 -0
- package/dist/capture/catalog.d.ts.map +1 -1
- package/dist/chunks/{chunk-PAAXKXWT.js → chunk-2AF5ANEB.js} +16 -2
- package/dist/chunks/chunk-2AF5ANEB.js.map +7 -0
- package/dist/chunks/{chunk-QXB75FLD.js → chunk-2E3CAABA.js} +8 -1
- package/dist/chunks/chunk-2E3CAABA.js.map +7 -0
- package/dist/chunks/{chunk-6ZKYQW33.js → chunk-3QPTSKDG.js} +139 -29
- package/dist/chunks/chunk-3QPTSKDG.js.map +7 -0
- package/dist/chunks/{chunk-BT6UELLP.js → chunk-DUIHQAIZ.js} +2 -2
- package/dist/chunks/{chunk-6BBFFEPO.js → chunk-DYEOFQ64.js} +15 -1
- package/dist/chunks/{chunk-6BBFFEPO.js.map → chunk-DYEOFQ64.js.map} +2 -2
- package/dist/chunks/{chunk-F2GKEXGI.js → chunk-PFF3X7OO.js} +272 -146
- package/dist/chunks/chunk-PFF3X7OO.js.map +7 -0
- package/dist/chunks/{fabric-runtime-state-VCLWTB55.js → fabric-runtime-state-H2NCRJWK.js} +797 -191
- package/dist/chunks/fabric-runtime-state-H2NCRJWK.js.map +7 -0
- package/dist/chunks/{settings-VEXI347I.js → settings-FUL3U3N4.js} +2 -2
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts +1 -0
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +1 -1
- package/dist/fabric-runtime-state.d.ts +2 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-state.d.ts +1 -0
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +218 -8
- package/dist/index.js.map +3 -3
- package/dist/providers/arg-normalization.d.ts +3 -0
- package/dist/providers/arg-normalization.d.ts.map +1 -1
- package/dist/providers/memory-provider.js +1 -1
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/repairs/active.d.ts +7 -0
- package/dist/repairs/active.d.ts.map +1 -0
- package/dist/repairs/apply.d.ts +7 -0
- package/dist/repairs/apply.d.ts.map +1 -0
- package/dist/repairs/catalog-digest.d.ts +5 -0
- package/dist/repairs/catalog-digest.d.ts.map +1 -0
- package/dist/repairs/classify.d.ts +10 -0
- package/dist/repairs/classify.d.ts.map +1 -0
- package/dist/repairs/compiler.d.ts +32 -0
- package/dist/repairs/compiler.d.ts.map +1 -0
- package/dist/repairs/promote.d.ts +4 -0
- package/dist/repairs/promote.d.ts.map +1 -0
- package/dist/repairs/store.d.ts +9 -0
- package/dist/repairs/store.d.ts.map +1 -0
- package/dist/repairs/types.d.ts +49 -0
- package/dist/repairs/types.d.ts.map +1 -0
- package/dist/residency/client.d.ts.map +1 -1
- package/dist/residency/host.js +3 -3
- package/dist/residency/pi-entry.js +3 -3
- package/dist/speculation/store.d.ts +11 -7
- package/dist/speculation/store.d.ts.map +1 -1
- package/dist/speculation/types.d.ts +2 -1
- package/dist/speculation/types.d.ts.map +1 -1
- package/docs/agents.md +1 -1
- package/docs/architecture.md +3 -1
- package/docs/configuration.md +4 -0
- package/docs/interface.md +1 -0
- package/docs/repairs.md +57 -0
- package/package.json +1 -1
- package/skills/fabric-exec/references/agents.md +3 -3
- package/dist/chunks/chunk-6ZKYQW33.js.map +0 -7
- package/dist/chunks/chunk-F2GKEXGI.js.map +0 -7
- package/dist/chunks/chunk-PAAXKXWT.js.map +0 -7
- package/dist/chunks/chunk-QXB75FLD.js.map +0 -7
- package/dist/chunks/fabric-runtime-state-VCLWTB55.js.map +0 -7
- /package/dist/chunks/{chunk-BT6UELLP.js.map → chunk-DUIHQAIZ.js.map} +0 -0
- /package/dist/chunks/{settings-VEXI347I.js.map → settings-FUL3U3N4.js.map} +0 -0
|
@@ -7,6 +7,9 @@ export interface ArgNormalizationSpec {
|
|
|
7
7
|
knownKeys?: readonly string[];
|
|
8
8
|
}
|
|
9
9
|
export type ActionArgNormalizer = (actionName: string, args: Record<string, unknown>) => Record<string, unknown>;
|
|
10
|
+
/** Unique declared key for a spilled spelling, or undefined when already
|
|
11
|
+
* canonical / ambiguous / unmatched. Used by the catalog repair compiler. */
|
|
12
|
+
export declare const uniqueDeclaredKeyForSpelling: (spilled: string, declared: readonly string[]) => string | undefined;
|
|
10
13
|
export declare const normalizeActionArgs: (args: Record<string, unknown>, spec: ArgNormalizationSpec) => Record<string, unknown>;
|
|
11
14
|
export declare const actionArgNormalizer: (describeActions: () => ReadonlyArray<Pick<FabricActionDescriptor, "name" | "inputSchema">>, table?: Record<string, ArgNormalizationSpec>) => ActionArgNormalizer;
|
|
12
15
|
//# sourceMappingURL=arg-normalization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arg-normalization.d.ts","sourceRoot":"","sources":["../../src/providers/arg-normalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAiC7D,MAAM,WAAW,oBAAoB;IAGnC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE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mBAAmB,GAC9B,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,oBAAoB,KACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAqBxB,CAAC;AAOF,eAAO,MAAM,mBAAmB,GAC9B,iBAAiB,MAAM,aAAa,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,EAC1F,QAAO,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAM,KAC/C,mBAgBF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi-tools-provider.d.ts","sourceRoot":"","sources":["../../src/providers/pi-tools-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pi-tools-provider.d.ts","sourceRoot":"","sources":["../../src/providers/pi-tools-provider.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EAEvB,cAAc,EACd,yBAAyB,EAE1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAmJrE,qBAAa,eAAgB,YAAW,cAAc;;IACpD,QAAQ,CAAC,IAAI,QAAQ;IACrB,QAAQ,CAAC,WAAW,gCAAgC;gBAQlD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,mBAAmB,EAC7B,aAAa,CAAC,EAAE,qBAAqB;IAgBjC,IAAI,CACR,OAAO,EAAE,yBAAyB,EAClC,QAAQ,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAY9B,QAAQ,CACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAS9C,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAsCtF,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,OAAO,CAAC;CAqTpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RepairCompiler } from "./compiler.js";
|
|
2
|
+
export declare const setActiveRepairCompiler: (compiler: RepairCompiler | undefined) => void;
|
|
3
|
+
export declare const clearActiveRepairCompiler: (compiler: RepairCompiler | undefined) => void;
|
|
4
|
+
export declare const getActiveRepairCompiler: () => RepairCompiler | undefined;
|
|
5
|
+
export declare const applyActiveArgRepairs: (ref: string, args: Record<string, unknown>, schema: Record<string, unknown>) => Record<string, unknown>;
|
|
6
|
+
export declare const applyActiveActionName: (provider: string, actionName: string, declared: readonly string[]) => string;
|
|
7
|
+
//# sourceMappingURL=active.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../src/repairs/active.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD,eAAO,MAAM,uBAAuB,GAAI,UAAU,cAAc,GAAG,SAAS,KAAG,IAE9E,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,UAAU,cAAc,GAAG,SAAS,KAAG,IAEhF,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,cAAc,GAAG,SAAmB,CAAC;AAEhF,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,EACX,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAiD,CAAC;AAE3E,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,UAAU,SAAS,MAAM,EAAE,KAC1B,MAA+E,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CatalogRepair } from "./types.js";
|
|
2
|
+
export declare const applyActionAliasRepairs: (provider: string, actionName: string, repairs: readonly CatalogRepair[], declared: readonly string[]) => string | undefined;
|
|
3
|
+
export declare const applyCatalogArgRepairs: (ref: string, args: Record<string, unknown>, repairs: readonly CatalogRepair[], schema: Record<string, unknown>) => {
|
|
4
|
+
args: Record<string, unknown>;
|
|
5
|
+
changed: boolean;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/repairs/apply.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAqDhD,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,SAAS,SAAS,aAAa,EAAE,EACjC,UAAU,SAAS,MAAM,EAAE,KAC1B,MAAM,GAAG,SAYX,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,EACX,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,SAAS,aAAa,EAAE,EACjC,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-digest.d.ts","sourceRoot":"","sources":["../../src/repairs/catalog-digest.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,GAAI,SAAS;IAChD,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,KAAG,MAKA,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RepairClassification } from "./types.js";
|
|
2
|
+
export declare const classifyInvalidArgs: (ref: string, message: string, extraKeys?: readonly string[]) => RepairClassification;
|
|
3
|
+
export declare const classifyUnknownAction: (ref: string) => RepairClassification;
|
|
4
|
+
export declare const classifyTypeErrors: (messages: readonly string[], enclosingTool?: string) => RepairClassification[];
|
|
5
|
+
export declare const classifyToolResult: (input: {
|
|
6
|
+
toolName?: string;
|
|
7
|
+
isError?: boolean;
|
|
8
|
+
content?: unknown;
|
|
9
|
+
}) => RepairClassification | undefined;
|
|
10
|
+
//# sourceMappingURL=classify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/repairs/classify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,oBAAoB,EAAe,MAAM,YAAY,CAAC;AAmFnF,eAAO,MAAM,mBAAmB,GAC9B,KAAK,MAAM,EACX,SAAS,MAAM,EACf,YAAW,SAAS,MAAM,EAAkC,KAC3D,oBAMF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,KAAG,oBAMnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,UAAU,SAAS,MAAM,EAAE,EAC3B,gBAAgB,MAAM,KACrB,oBAAoB,EA8CtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,KAAG,oBAAoB,GAAG,SAwC1B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CatalogRepair, type RepairClassification, type RepairStatus } from "./types.js";
|
|
2
|
+
export interface RepairCompilerOptions {
|
|
3
|
+
agentDir: string;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class RepairCompiler {
|
|
7
|
+
#private;
|
|
8
|
+
readonly directory: string;
|
|
9
|
+
readonly enabled: boolean;
|
|
10
|
+
constructor(options: RepairCompilerOptions);
|
|
11
|
+
get catalogDigest(): string;
|
|
12
|
+
get repairs(): readonly CatalogRepair[];
|
|
13
|
+
setCatalogSurface(surface: {
|
|
14
|
+
providers: readonly string[];
|
|
15
|
+
capturedTools: readonly string[];
|
|
16
|
+
}): void;
|
|
17
|
+
observe(classification: RepairClassification, options?: {
|
|
18
|
+
countError?: boolean;
|
|
19
|
+
}): CatalogRepair | undefined;
|
|
20
|
+
recordInvocationError(): void;
|
|
21
|
+
observeInvalidArgs(ref: string, args: Record<string, unknown>, declared: readonly string[], message: string, options?: {
|
|
22
|
+
countError?: boolean;
|
|
23
|
+
extraKeys?: readonly string[];
|
|
24
|
+
}): CatalogRepair | undefined;
|
|
25
|
+
observeUnknownAction(provider: string, actionName: string, declared: readonly string[], options?: {
|
|
26
|
+
countError?: boolean;
|
|
27
|
+
}): CatalogRepair | undefined;
|
|
28
|
+
applyArgs(ref: string, args: Record<string, unknown>, schema: Record<string, unknown>): Record<string, unknown>;
|
|
29
|
+
applyActionName(provider: string, actionName: string, declared: readonly string[]): string;
|
|
30
|
+
status(): RepairStatus;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=compiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/repairs/compiler.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAEzB,KAAK,YAAY,EAElB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAWD,qBAAa,cAAc;;IACzB,QAAQ,CAAC,SAAS,EAAE,M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E,GAC1B,MAAM;IAeT,MAAM,IAAI,YAAY;CAwDvB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CatalogRepair } from "./types.js";
|
|
2
|
+
export declare const keyAliasCandidate: (ref: string, extraKeys: readonly string[], declared: readonly string[]) => CatalogRepair | undefined;
|
|
3
|
+
export declare const actionAliasCandidate: (provider: string, actionName: string, declared: readonly string[]) => CatalogRepair | undefined;
|
|
4
|
+
//# sourceMappingURL=promote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../src/repairs/promote.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EACX,WAAW,SAAS,MAAM,EAAE,EAC5B,UAAU,SAAS,MAAM,EAAE,KAC1B,aAAa,GAAG,SAMlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,UAAU,SAAS,MAAM,EAAE,KAC1B,aAAa,GAAG,SASlB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RepairTableFile } from "./types.js";
|
|
2
|
+
export declare const repairsDirectory: (agentDir: string) => string;
|
|
3
|
+
export interface LoadedRepairTable {
|
|
4
|
+
table: RepairTableFile;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const loadRepairTable: (directory: string, catalogDigest: string) => LoadedRepairTable;
|
|
8
|
+
export declare const saveRepairTable: (directory: string, table: RepairTableFile) => RepairTableFile;
|
|
9
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/repairs/store.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,KAAG,MACV,CAAC;AAwN3C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,eAAe,MAAM,KACpB,iBA4BF,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,OAAO,eAAe,KACrB,eA2BC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const REPAIR_TABLE_VERSION: 1;
|
|
2
|
+
export declare const MAX_CATALOG_REPAIRS = 256;
|
|
3
|
+
export type RepairStage = "invocation_outer_schema" | "invocation_typecheck" | "invocation_args" | "invocation_unknown_action" | "didactic" | "effect";
|
|
4
|
+
interface KeyAliasRepair {
|
|
5
|
+
kind: "keyAlias";
|
|
6
|
+
ref: string;
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
}
|
|
10
|
+
interface ActionAliasRepair {
|
|
11
|
+
kind: "actionAlias";
|
|
12
|
+
provider: string;
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
}
|
|
16
|
+
export type CatalogRepair = KeyAliasRepair | ActionAliasRepair;
|
|
17
|
+
export interface RepairTableFile {
|
|
18
|
+
version: typeof REPAIR_TABLE_VERSION;
|
|
19
|
+
catalogDigest: string;
|
|
20
|
+
repairs: CatalogRepair[];
|
|
21
|
+
createdAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RepairClassification {
|
|
25
|
+
stage: RepairStage;
|
|
26
|
+
fingerprint: string;
|
|
27
|
+
/** When set, a unique mapping the compiler may insert on first hit. */
|
|
28
|
+
candidate?: CatalogRepair;
|
|
29
|
+
}
|
|
30
|
+
interface RepairFingerprintCount {
|
|
31
|
+
fingerprint: string;
|
|
32
|
+
stage: RepairStage;
|
|
33
|
+
count: number;
|
|
34
|
+
}
|
|
35
|
+
export interface RepairStatus {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
catalogDigest: string;
|
|
38
|
+
repairCount: number;
|
|
39
|
+
applyHits: number;
|
|
40
|
+
invocationErrors: number;
|
|
41
|
+
effectDropped: number;
|
|
42
|
+
storeError?: string;
|
|
43
|
+
fingerprints: RepairFingerprintCount[];
|
|
44
|
+
repairs: CatalogRepair[];
|
|
45
|
+
}
|
|
46
|
+
export declare const repairIdentity: (repair: CatalogRepair) => string;
|
|
47
|
+
export declare const emptyRepairTable: (catalogDigest: string, now?: string) => RepairTableFile;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/repairs/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,EAAG,CAAU,CAAC;AAC/C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GACnB,yBAAyB,GACzB,sBAAsB,GACtB,iBAAiB,GACjB,2BAA2B,GAC3B,UAAU,GACV,QAAQ,CAAC;AAEb,UAAU,cAAc;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,oBAAoB,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,UAAU,sBAAsB;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,GAAI,QAAQ,aAAa,KAAG,MAKtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,eAAe,MAAM,EACrB,YAA8B,KAC7B,eAMD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/residency/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/residency/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAK3H,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAuB,MAAM,kBAAkB,CAAC;AACl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AAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAatD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CA4KpF"}
|
package/dist/residency/host.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runResidentHostFromConfigPath
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-DUIHQAIZ.js";
|
|
5
|
+
import "../chunks/chunk-PFF3X7OO.js";
|
|
6
6
|
import "../chunks/chunk-PM5I335G.js";
|
|
7
7
|
import "../chunks/chunk-VPPIJRNZ.js";
|
|
8
8
|
import "../chunks/chunk-QWIKS6CT.js";
|
|
9
9
|
import "../chunks/chunk-FL52NCFS.js";
|
|
10
10
|
import "../chunks/chunk-WRKD7W34.js";
|
|
11
|
-
import "../chunks/chunk-
|
|
11
|
+
import "../chunks/chunk-2E3CAABA.js";
|
|
12
12
|
import "../chunks/chunk-7B55UIZL.js";
|
|
13
13
|
import "../chunks/chunk-R7ZFQATZ.js";
|
|
14
14
|
import "../chunks/chunk-2YCOXT4W.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runResidentHostFromConfigPath
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-DUIHQAIZ.js";
|
|
4
|
+
import "../chunks/chunk-PFF3X7OO.js";
|
|
5
5
|
import "../chunks/chunk-PM5I335G.js";
|
|
6
6
|
import "../chunks/chunk-VPPIJRNZ.js";
|
|
7
7
|
import "../chunks/chunk-QWIKS6CT.js";
|
|
8
8
|
import "../chunks/chunk-FL52NCFS.js";
|
|
9
9
|
import "../chunks/chunk-WRKD7W34.js";
|
|
10
|
-
import "../chunks/chunk-
|
|
10
|
+
import "../chunks/chunk-2E3CAABA.js";
|
|
11
11
|
import "../chunks/chunk-7B55UIZL.js";
|
|
12
12
|
import "../chunks/chunk-R7ZFQATZ.js";
|
|
13
13
|
import "../chunks/chunk-2YCOXT4W.js";
|
|
@@ -6,10 +6,14 @@ import type { FabricSpeculationConfig, FabricSpeculationReplay, FabricSpeculatio
|
|
|
6
6
|
* Correctness contract: a stored promise may only be served to a real call
|
|
7
7
|
* when (1) the mutation epoch has not advanced since the speculation launched
|
|
8
8
|
* — the epoch bumps after any real in-program invocation whose effect kind is
|
|
9
|
-
* not "none" —
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* not "none" — (2) the entry's freshness checker, when present, still holds,
|
|
10
|
+
* and (3) the entry was launched against the same provider binding the real
|
|
11
|
+
* call resolved: the binding token is part of the cache key, so an entry that
|
|
12
|
+
* a reset could not abort (its speculate() was still mid-describe when the
|
|
13
|
+
* binding was replaced) can never match the replacement's serve key. Entries
|
|
14
|
+
* are take-once (identical duplicate calls each need their own speculation)
|
|
15
|
+
* and are aborted + counted wasted when their execution finishes without
|
|
16
|
+
* serving them or when the turn resets.
|
|
13
17
|
*/
|
|
14
18
|
export declare class FabricSpeculationStore implements FabricSpeculationRuntime {
|
|
15
19
|
#private;
|
|
@@ -19,14 +23,14 @@ export declare class FabricSpeculationStore implements FabricSpeculationRuntime
|
|
|
19
23
|
pending: number;
|
|
20
24
|
};
|
|
21
25
|
bumpEpoch(): void;
|
|
22
|
-
static key(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown
|
|
26
|
+
static key(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown>, bindingToken: string): string;
|
|
23
27
|
/**
|
|
24
28
|
* Register and start a speculative invocation. Returns false when at
|
|
25
29
|
* capacity; the candidate is dropped silently (a miss costs nothing, the
|
|
26
30
|
* real call executes normally later).
|
|
27
31
|
*/
|
|
28
|
-
launch(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown>, execute: (signal: AbortSignal) => Promise<unknown>, freshness: FabricFreshnessChecker | undefined, replay: FabricSpeculationReplay): boolean;
|
|
29
|
-
tryServe(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown
|
|
32
|
+
launch(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown>, execute: (signal: AbortSignal) => Promise<unknown>, freshness: FabricFreshnessChecker | undefined, replay: FabricSpeculationReplay, bindingToken: string): boolean;
|
|
33
|
+
tryServe(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown>, bindingToken: string): Promise<FabricSpeculationServeResult>;
|
|
30
34
|
/** Execution for this tool call finished: everything unserved is waste. */
|
|
31
35
|
onInvocationEnd(parentToolCallId: string): void;
|
|
32
36
|
/** Turn backstop: speculation never outlives a turn. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/speculation/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAcpB
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/speculation/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAcpB;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,YAAW,wBAAwB;;gBAgBzD,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,eAAe,GAAG,YAAY,GAAG,YAAY,CAAC;IAMhG,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,KAAK,IAAI,sBAAsB,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;IAIrD,SAAS,IAAI,IAAI;IAIjB,MAAM,CAAC,GAAG,CACR,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,YAAY,EAAE,MAAM,GACnB,MAAM;IAIT;;;;OAIG;IACH,MAAM,CACJ,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,EAClD,SAAS,EAAE,sBAAsB,GAAG,SAAS,EAC7C,MAAM,EAAE,uBAAuB,EAC/B,YAAY,EAAE,MAAM,GACnB,OAAO;IAmCJ,QAAQ,CACZ,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,4BAA4B,CAAC;IA0BxC,2EAA2E;IAC3E,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI;IAS/C,wDAAwD;IACxD,KAAK,IAAI,IAAI;CAqBd"}
|
|
@@ -36,8 +36,9 @@ export type FabricSpeculationServeResult = {
|
|
|
36
36
|
* the speculation package.
|
|
37
37
|
*/
|
|
38
38
|
export interface FabricSpeculationRuntime {
|
|
39
|
-
tryServe(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown
|
|
39
|
+
tryServe(parentToolCallId: string, ref: string, preparedArgs: Record<string, unknown>, bindingToken: string): Promise<FabricSpeculationServeResult>;
|
|
40
40
|
bumpEpoch(): void;
|
|
41
|
+
reset?(): void;
|
|
41
42
|
onInvocationEnd?(parentToolCallId: string): void;
|
|
42
43
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QAAQ,CACN,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACzC,SAAS,IAAI,IAAI,CAAC;IAClB,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,eAAe,CAAC,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD"}
|
package/docs/agents.md
CHANGED
|
@@ -228,7 +228,7 @@ localterm start
|
|
|
228
228
|
|
|
229
229
|
`/fabric agents` lists the children. Run `/fabric attach <id>` to show the correct attach command. Abort signals propagate to the transport and the selected child process. When a program uses orchestration entry points such as `agent`/`workflow.agent`, `agents.run`/`agents.wait`/`agents.ask`, `council.run`, or `rlm.query`, Fabric increases the whole-program `executor.timeoutMs` to at least `agents.timeoutMs`. The same increase applies to `agents.*` refs called through `tools.call()` and to refs calculated at runtime. The parent deadline then cannot stop a child that remains within its own agent budget.
|
|
230
230
|
|
|
231
|
-
Set `worktree: true` to create a dedicated Git worktree and a `pi-fabric/<name>-<id>` branch from the repository containing the selected `cwd`. Fabric retains worktrees for inspection until you call `agents.cleanup()`. When the selected cwd is a repository subdirectory, Fabric uses the matching subdirectory in the generated worktree when it exists; otherwise it uses the worktree root. The reported effective cwd is the generated worktree path, and Pi evaluates that generated path as its own canonical cwd. The caller's project and mesh roots remain unchanged, so a child targeting another repository still belongs to the orchestrating Fabric topology. A recursive child in a worktree stays in the same participant directory and does not create another `.pi/fabric/mesh` inside that worktree.
|
|
231
|
+
Set `worktree: true` to create a dedicated Git worktree and a `pi-fabric/<name>-<id>` branch from the repository containing the selected `cwd`. Fabric writes that worktree at `<repo>/.pi/fabric/worktrees/<id>` so copy-on-write cloning can keep ignored build artifacts on the same volume, and it records the path in the repository `.git/info/exclude` file. Simple `git worktree add` commands run through `pi.bash` take the same clone-first path. Fabric retains worktrees for inspection until you call `agents.cleanup()`. When the selected cwd is a repository subdirectory, Fabric uses the matching subdirectory in the generated worktree when it exists; otherwise it uses the worktree root. The reported effective cwd is the generated worktree path, and Pi evaluates that generated path as its own canonical cwd. The caller's project and mesh roots remain unchanged, so a child targeting another repository still belongs to the orchestrating Fabric topology. A recursive child in a worktree stays in the same participant directory and does not create another `.pi/fabric/mesh` inside that worktree.
|
|
232
232
|
|
|
233
233
|
[Model-guidance components](components.md#model-facing-guidance-components) can target participants by canonical provider/model. Direct agents and actors retain their role prompt and receive matching append guidance after it. Recursive Pi children load the project components and resolve their own replaceable Fabric execution slot, so the parent does not duplicate guidance. Durable owners use the latest atomically committed guidance snapshot for each launch. Guidance changes prompts only; it cannot widen tools, approvals, or committed capabilities. Task text, message envelopes, run IDs, and timestamps stay out of the guidance system prompt, so repeated runs with the same role, model, and component projection retain a byte-stable prefix.
|
|
234
234
|
|
package/docs/architecture.md
CHANGED
|
@@ -25,6 +25,8 @@ ActionRegistry ◀── staged commit ── ComponentSupervisor
|
|
|
25
25
|
ActivityStore → compact widget + footer status + interactive dashboard
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
Unique provider extra keys and unknown actions feed a [catalog repair table](repairs.md). Session JSONL is the log; `current.json` holds unique schema maps. Effect failures (bash, edit miss) and guest typecheck are classified for status but never promoted.
|
|
29
|
+
|
|
28
30
|
In the default QuickJS runtime, guest code runs without `process`, `require`, filesystem, network, or subprocess globals. Every effect crosses the host bridge, and schemas, approvals, audit records, timeouts, and cancellation apply there. Each execution gets a fresh QuickJS context. Strings the caller names in the `payloads` tool parameter appear as `π.key`. Reading a missing key throws a clear, actionable error that lists the provided keys.
|
|
29
31
|
|
|
30
32
|
The optional `node-process` executor runs the same type-checked guest API and host-call protocol inside a fresh child process with a configurable V8 heap. It serves workloads that exceed the WASM32 memory ceiling. This mode is not a security boundary, because Node's `vm` module cannot safely contain hostile code. Fabric restricts this mode to trusted configuration and describes it as unsafe in `/fabric settings`. Schema enforce mode disables it. Parent-side deadlines and cancellation terminate the whole child process.
|
|
@@ -123,7 +125,7 @@ Control topics and topology and legacy state prefixes are reserved from guest me
|
|
|
123
125
|
- `/fabric prewalk` pre-authorizes the same one-shot delegation through `prewalk.model` or an interactively selected Pi executor. The command adapts [Stencil's Prewalk](https://stencil.so/blog/prewalk) and [oh-my-pi's in-place implementation](https://github.com/can1357/oh-my-pi/blob/main/packages/coding-agent/src/session/agent-session.ts) into a prompt-free form. It uses a coarser atomic boundary. The first monitored mutation marks the outer Fabric invocation, every remaining nested call still runs, and the executor starts only from the complete native `fabric_exec` call/result pair.
|
|
124
126
|
- Claude `extensions: true` preserves the user's normal Claude Code customizations, including applicable settings and hooks. Those hooks execute with their usual host privileges. Set `extensions: false` for Claude safe mode. When allowed, `Bash` stays unrestricted inside the child, in the same way as Fabric's `bash` capability.
|
|
125
127
|
- Claude model discovery sends a local initialization control request and never invokes a model. One-shot and actor activations use the account or API billing already configured in Claude Code. Fabric records the CLI's reported `total_cost_usd` in its normal usage and budget ledgers.
|
|
126
|
-
- A Git worktree isolates files. It does not isolate credentials, network access, processes, or external services.
|
|
128
|
+
- A Git worktree isolates files. It does not isolate credentials, network access, processes, or external services. Fabric-managed worktrees live at `<repo>/.pi/fabric/worktrees/<id>` and clone the source tree copy-on-write when the filesystem allows it.
|
|
127
129
|
- Fabric projects agent transcripts from local `events.jsonl` run logs. The dashboard redacts common credentials from compact tool previews. The permission-restricted raw event log can still contain assistant text, tool arguments and results, diagnostics, and extension protocol payloads. Persisted `fabric_exec` traces also retain projected bash command text for command previews. Treat retained session and run data as sensitive.
|
|
128
130
|
- Fabric stops session-resident background children when the parent Pi session shuts down. A hidden per-root resident host launches `agents.spawn({ residency: "durable" })`, and that child continues after the TUI exits. A detached spawn sends a follow-up completion message unless the caller later waits for it or `notifyOnComplete` is disabled. Resident completion messages queue in mesh state until Main resumes. Durable participant lifecycle subscriptions deliver source-qualified Pi and run notifications across roots, agents, and actors with no transcript disclosure. Completed worktrees are retained on purpose.
|
|
129
131
|
- Fabric suspends session-resident actors on shutdown and restores them after project trust. `agents.create({ residency: "durable" })` transfers execution to the hidden resident host before it returns. The mailbox, mesh subscriptions, relayed Main events, and runner session continue after Main exits.
|
package/docs/configuration.md
CHANGED
|
@@ -461,3 +461,7 @@ Mesh topics, shared state, and the participant directory remain project-scoped.
|
|
|
461
461
|
## Compaction
|
|
462
462
|
|
|
463
463
|
The deterministic, LLM-free compaction engine is on by default. It keeps Pi's bounded `keepRecentTokens` continuity tail. `compaction.targetContextRatio` sets a hard occupancy ceiling. Set `compaction.engine` to `"pi"` to restore pi-core compaction. When pi-vcc is also installed, Fabric takes precedence for automatic compaction. An explicit `/pi-vcc` command always uses pi-vcc's engine. See [compaction](compaction.md) for invariants, loss guarantees, sections, and limits.
|
|
464
|
+
|
|
465
|
+
## Catalog repairs
|
|
466
|
+
|
|
467
|
+
Silent invocation repairs are on by default. `repairs.enabled` controls the catalog-scoped table at `~/.pi/agent/fabric/repairs/current.json`. Inspect it with `/fabric repairs`. See [catalog repairs](repairs.md).
|
package/docs/interface.md
CHANGED
|
@@ -102,6 +102,7 @@ async invoke(actionName, args, context) {
|
|
|
102
102
|
/fabric messages <actor-id>
|
|
103
103
|
/fabric attach <agent-id>
|
|
104
104
|
/fabric stop <actor-or-agent-id>
|
|
105
|
+
/fabric repairs
|
|
105
106
|
```
|
|
106
107
|
|
|
107
108
|
Actor slash commands mirror the [global template API](agents.md#global-actor-templates). `/fabric global` lists templates. `/fabric import <name> [as <new>]` stamps one into the project. `/fabric export <id> [--overwrite]` promotes a project actor. `/fabric log <id>` previews an actor or run transcript, and `/fabric export-log <id> [path]` writes the raw `session.jsonl` plus retained `runs/` to disk.
|
package/docs/repairs.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Catalog repairs
|
|
2
|
+
|
|
3
|
+
Pi Fabric learns **silent catalog-argument repairs** from unique invocation near-misses. It does not rewrite guidelines, `AGENTS.md`, or the system prompt. Session JSONL remains the only log. The durable product is a catalog-scoped table of spilled→declared maps.
|
|
4
|
+
|
|
5
|
+
KPI: repeat **invocation** fingerprints → 0. Bash nonzero, edit misses, missing files, and guest typecheck/syntax are classified for status but never promoted.
|
|
6
|
+
|
|
7
|
+
## Loop
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
invalid args / unknown action
|
|
11
|
+
│
|
|
12
|
+
unique bijection against the live schema
|
|
13
|
+
│
|
|
14
|
+
├─ effect / didactic / typecheck → count, do not promote
|
|
15
|
+
└─ unique extra key or unique verb → insert into current.json
|
|
16
|
+
│
|
|
17
|
+
next ActionRegistry prepare / resolve applies the row
|
|
18
|
+
(canonical input is a no-op)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Repair-candidate observation and apply happen in `ActionRegistry` only. Unique extra keys are observed on the **caller's spilled args** before `prepareArguments`, so a bundled lexicon repair still persists the map for providers that lack one. `tool_execution_end` records effect drops and non-promotable fingerprints without double-counting inner invocation errors.
|
|
22
|
+
|
|
23
|
+
## Store
|
|
24
|
+
|
|
25
|
+
`~/.pi/agent/fabric/repairs/current.json` (under `PI_CODING_AGENT_DIR`).
|
|
26
|
+
|
|
27
|
+
`catalogDigest` hashes sorted provider names plus captured tool names. A digest change starts empty and **clears in-memory fingerprint counters** so a previous candidate cannot be re-inserted. Schema field/action renames do not bump the digest; apply re-proves each row's unique mapping against the **live** declared names instead. Repairs are **global across models**, not per project.
|
|
28
|
+
|
|
29
|
+
Table rows:
|
|
30
|
+
|
|
31
|
+
- `keyAlias`: extra argument key → declared key (`sessionId` → `session`)
|
|
32
|
+
- `actionAlias`: spilled action name → declared name (never applied when a committed capability view pins the call)
|
|
33
|
+
|
|
34
|
+
Cap: 256 rows. Promotion is on the first unique hit; uniqueness against the live schema is the bound. Insert is identity-keyed (idempotent) and locked across Pi processes sharing the agent directory; stale-lock recovery is an exclusive rename claim, so racing reapers can never delete a lock a fresh writer owns. Persistence failures never fail the user's invocation and appear in `/fabric repairs`. Apply is a no-op when the schema accepts extension keys, the live mapping is absent or ambiguous, or the call is already canonical.
|
|
35
|
+
|
|
36
|
+
Two failure modes stay visible, never silent:
|
|
37
|
+
|
|
38
|
+
- A **transient catalog** (capture suspension between sessions or during `/fabric reload`) never re-keys the table: the surface freezes until the catalog re-arms, so promotion cannot persist rows under an empty-catalog digest that would destroy the stable table.
|
|
39
|
+
- A **damaged table** (unreadable or malformed `current.json`) surfaces as `storeError` in `/fabric repairs`, blocks the merge that would overwrite it, and keeps promoted rows active in memory. A missing table, or one persisted under a different digest, starts fresh without an error.
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
/fabric repairs # status, top fingerprints, current table
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"repairs": {
|
|
52
|
+
"enabled": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Disable with `"enabled": false`. Promotion never edits execution guidance or Schema text.
|
package/package.json
CHANGED
|
@@ -22,11 +22,11 @@ For Pi leaf agents, selecting `cwd` neither grants nor requires project trust. F
|
|
|
22
22
|
- `tools` defaults to `agents.defaultTools`. Claude maps `read→Read`, `grep→Grep`, `find/ls→Glob`, `bash→Bash`, `edit→Edit`, and `write→Write`; other tool names fail before launch.
|
|
23
23
|
- `schema` is a JSON Schema; the worker returns validated structured data in `result.value`.
|
|
24
24
|
- `cwd` changes only a leaf child's execution directory. Workflow helpers and `council.run()` forward it; recursive `rlm.query()` deliberately does not accept it. Persistent actor definitions and trajectory handoff also do not accept it. A request combining `cwd` with `recursive: true` is rejected before launch.
|
|
25
|
-
- `worktree: true` creates a dedicated Git worktree on branch `pi-fabric/<name>-<id>` from the repository containing the selected `cwd`, retained until `agents.cleanup()`. A selected repository subdirectory is preserved in the generated worktree when available. The effective cwd is the generated canonical path. Project and mesh ownership remain those of the caller.
|
|
26
|
-
- Worktree path gotcha
|
|
25
|
+
- `worktree: true` creates a dedicated Git worktree on branch `pi-fabric/<name>-<id>` from the repository containing the selected `cwd`, retained until `agents.cleanup()`. Fabric writes it at `<repo>/.pi/fabric/worktrees/<id>` (agent id, not the target repo name) and clone-first copy-on-write keeps ignored build artifacts when the filesystem supports it. A selected repository subdirectory is preserved in the generated worktree when available. The effective cwd is the generated canonical path. Project and mesh ownership remain those of the caller.
|
|
26
|
+
- Worktree path gotcha: the directory name is the agent id, not the target repo. Repo identity lives in the registered worktree list and branch tip. Never instruct an agent to verify its location by directory-name pattern; verify by repo (`git rev-parse --show-toplevel` + `git log -1 --format=%H` against the expected base, or `git remote get-url origin`).
|
|
27
27
|
- Preferred pattern for parallel implementers (deterministic, full branch control): pre-create the worktrees yourself in the target repo (`git worktree add -b <branch> <path> <base>`), pass each canonical path as `cwd`, leave `worktree` unset, and state the exact expected top-level in the task. Canonical-path gotcha on macOS: `git rev-parse --show-toplevel` reports `/private/tmp/...` for worktrees created under `/tmp/...` — assign and verify the canonical `/private` form or the agent's guard will correctly refuse.
|
|
28
28
|
- Give every autonomous coding agent a mandatory first command that verifies repo identity (exact canonical toplevel or remote URL) and a hard rule to abort with zero changes on mismatch. Guards cost one cheap round when wrong and prevent cross-repo contamination when right — four successive guards caught a wrong-repo worktree, a self-inflicted symlink mismatch, and a too-literal directory check at zero bytes of damage.
|
|
29
|
-
- Cleanup after cancelled/failed agent runs: check `agents.list({ scope: "project" })` and `agents.stop` any still-running handles first; worktree registrations live in the repo that OWNS the worktree (check `git worktree list` in every candidate repo
|
|
29
|
+
- Cleanup after cancelled/failed agent runs: check `agents.list({ scope: "project" })` and `agents.stop` any still-running handles first; worktree registrations live in the repo that OWNS the worktree (check `git worktree list` in every candidate repo; `.pi/fabric/worktrees/<id>` names the agent, not the repo), then `git worktree remove --force` + `git branch -D` + `git worktree prune` in each. Leave pre-existing non-agent worktrees alone; filter by the branch prefix your runs created (e.g. `pi-fabric/<name>`).
|
|
30
30
|
- `residency` is available on `agents.spawn` only: `"session"` (default) ties the run to the current Pi host; `"durable"` launches it on Fabric's hidden resident host so it can finish after Main exits. Durable handles still support `status`, `wait`, `log`, `stop`, and `cleanup` when the same root resumes. It requires a trusted project mesh and is unavailable in Schema enforce mode.
|
|
31
31
|
- Omit `timeoutMs` normally. It defaults to `agents.timeoutMs` (60 minutes by default), and per-call values below that configured default are ignored. Set it only to request a longer run.
|
|
32
32
|
|