pi-fabric 0.45.2 → 0.46.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/dist/actors/manager.d.ts +2 -0
- package/dist/actors/manager.d.ts.map +1 -1
- package/dist/actors/manager.js +149 -9
- package/dist/actors/manager.js.map +1 -1
- package/dist/core/capability-advisory.d.ts.map +1 -1
- package/dist/core/capability-advisory.js +59 -33
- package/dist/core/capability-advisory.js.map +1 -1
- package/dist/core/capability-fingerprint.d.ts +2 -0
- package/dist/core/capability-fingerprint.d.ts.map +1 -1
- package/dist/core/capability-fingerprint.js +35 -0
- package/dist/core/capability-fingerprint.js.map +1 -1
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/fabric-state.js +3 -0
- package/dist/fabric-state.js.map +1 -1
- package/dist/residency/host.d.ts.map +1 -1
- package/dist/residency/host.js +2 -0
- package/dist/residency/host.js.map +1 -1
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +6 -2
- package/dist/ui/dashboard.js.map +1 -1
- package/dist/ui/format.d.ts +1 -0
- package/dist/ui/format.d.ts.map +1 -1
- package/dist/ui/format.js +29 -0
- package/dist/ui/format.js.map +1 -1
- package/docs/architecture.md +1 -1
- package/docs/capability-combustion.md +28 -10
- package/docs/configuration.md +1 -1
- package/package.json +1 -1
package/dist/ui/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAU,EAAE,CACjD,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;KAChB,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC;KACvC,OAAO,CAAC,4CAA4C,EAAE,GAAG,CAAC;KAC1D,OAAO,CAAC,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AC;oBACpC,IAAI,CAAC,KAAK,EAAE,CAAC;wBACX,KAAK,GAAG,GAAG,CAAC;wBACZ,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;oBAC7B,CAAC;oBACD,MAAM;gBACR,CAAC;gBACD,KAAK,GAAG,SAAS,CAAC;gBAClB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;YAC7B,CAAC;YACD,IAAI,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7B,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;YAAE,MAAM;IACtC,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,GAAG,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IACpF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
package/docs/architecture.md
CHANGED
|
@@ -87,4 +87,4 @@ Cross-process control is target-resolved, not broadcast. The sender resolves a p
|
|
|
87
87
|
- Approving `agents.create()` delegates future subscribed events to that actor until it is stopped. With durable residency that delegation outlives the approving TUI process. Each activation uses the actor's fixed runner and persisted tool allowlist/model setting; review them before approving a persistent actor. Tool changes apply only to later activations.
|
|
88
88
|
- The hidden resident host is started only by an approved durable `agents.spawn`/`agents.create` action in a trusted mesh-enabled project. Its mode-`0600` config, command spool, run metadata, and PID lock live below the root's mesh residency directory. This IPC is crash-conservative—an interrupted claimed request reports an indeterminate outcome rather than being replayed—but it is not a boundary against arbitrary host filesystem access; trusted code with direct access to `.pi/fabric` can corrupt residency state just as it can corrupt the mesh. Empty resident hosts exit after a short grace period.
|
|
89
89
|
- Actor responses can enter the main context only through the delivery policy fixed at creation. Directive output is schema-validated, but it is still untrusted model output that the main agent should weigh.
|
|
90
|
-
- Project-scoped actor execution is ownership-gated: passive sessions do not consume events, run mailboxes, expose private actor data, mutate settings, or persist shutdown state, and they reload the registry after acquiring ownership. Shared `actors.json` updates use a stale-safe lock plus ownership-aware read/merge/write, so one actor owner cannot overwrite another owner's newer records. Use session scope when roots should define fully independent actor sets. Mesh events are append-only until bounded log compaction retains the newest tail; archive or remove an old mesh root when even that retained history is no longer useful.
|
|
90
|
+
- Project-scoped actor execution is ownership-gated: passive sessions do not consume events, run mailboxes, expose private actor data, mutate settings, or persist shutdown state, and they reload the registry after acquiring ownership. When no live owner is advertised for a persisted actor (expired or missing host lease) and its lineage root itself is not alive in the participant directory, a later residency-matched host may adopt it and rebind `rootId`. Adoption is a fenced registry write: ownership is granted only after the rebound `rootId` and an `adoptedAt` fencing timestamp persist under the registry lock, so simultaneous starters converge on exactly one adopter, and a lineage adopted within the 30s grace window is left to its (possibly not yet visible) adopter. Shared `actors.json` updates use a stale-safe lock plus ownership-aware read/merge/write, so one actor owner cannot overwrite another owner's newer records. Use session scope when roots should define fully independent actor sets. Mesh events are append-only until bounded log compaction retains the newest tail; archive or remove an old mesh root when even that retained history is no longer useful.
|
|
@@ -23,16 +23,24 @@ when the available evidence says it will be used.
|
|
|
23
23
|
|
|
24
24
|
Captured tools are fingerprinted by source namespace. Each source's corpus is
|
|
25
25
|
its tools' names plus descriptions. A prompt scores against each unburned
|
|
26
|
-
source as the sum of
|
|
26
|
+
source as the sum of per-word evidence:
|
|
27
27
|
|
|
28
28
|
$$
|
|
29
|
-
s(p, j) = \sum_{
|
|
29
|
+
s(p, j) = \sum_{w \in W(p)} \max_{t \in R(w) \cap T(j)} \frac{1}{\mathrm{df}(t)}, \qquad \mathrm{df}(t) = \Bigl|\{ j : t \in T(j) \}\Bigr|
|
|
30
30
|
$$
|
|
31
31
|
|
|
32
|
+
where $W(p)$ is the prompt's written words and $R(w)$ the readings of one
|
|
33
|
+
word — its camelCase atoms plus the word itself, both held to the corpus
|
|
34
|
+
token rules. One written word therefore contributes exactly one unit of
|
|
35
|
+
evidence: the rarity of its rarest matched reading. Casing is just spelling:
|
|
36
|
+
every casing of a word has the same reading set, so a camelCase brand word
|
|
37
|
+
("GitHub" vs "github" vs "GITHUB") can never earn more quanta than any other
|
|
38
|
+
spelling of itself.
|
|
39
|
+
|
|
32
40
|
The weight is plain $1/\mathrm{df}$, with no logarithm. The catalog is too
|
|
33
41
|
small for classic idf: with four sources, $\ln(4/2) < 1$, so a rare term would
|
|
34
42
|
score below a common one and matches would starve. Weight $1/\mathrm{df}$
|
|
35
|
-
keeps "two distinctive
|
|
43
|
+
keeps "two distinctive words about equal to one source" true at any catalog
|
|
36
44
|
size.
|
|
37
45
|
|
|
38
46
|
Pre-ignition filters:
|
|
@@ -42,8 +50,17 @@ Pre-ignition filters:
|
|
|
42
50
|
ambient context rather than user intent, and its vocabulary would poison the
|
|
43
51
|
fingerprint. The matcher removes those regions before tokenization. An
|
|
44
52
|
unclosed trailing tag counts as stripped too.
|
|
45
|
-
- **At least two matched
|
|
46
|
-
or "recent" is a vocabulary coincidence
|
|
53
|
+
- **At least two matched written words.** A lone distinctive word such as
|
|
54
|
+
"project" or "recent" is a vocabulary coincidence, not intent. The gate
|
|
55
|
+
and the scorer share one unit — the written word — so casing can inflate
|
|
56
|
+
neither the count nor the score. One exception: a word whose rarest
|
|
57
|
+
reading is found in exactly one source (df = 1) already weighs a full
|
|
58
|
+
score quantum, the smallest unit of unambiguous evidence the scorer can
|
|
59
|
+
express, so a single source-unique word earns the weak band on its own,
|
|
60
|
+
with sustained warmth doing the transience filtering.
|
|
61
|
+
- **Latin-only tokenization.** Matching keeps latin alphanumerics of two or
|
|
62
|
+
more characters; CJK scripts atomize to nothing, so a CJK prompt matches
|
|
63
|
+
through the latin brand words it contains.
|
|
47
64
|
- **Stopword filtering** during tokenization (see `capability-fingerprint.ts`).
|
|
48
65
|
|
|
49
66
|
## Ignition bands and warmth
|
|
@@ -54,11 +71,12 @@ The dynamics hold several constants: band width, retention, smoke step, streak
|
|
|
54
71
|
cap, session cap. Every one of them projects from two primitives plus the
|
|
55
72
|
user-facing $\theta$:
|
|
56
73
|
|
|
57
|
-
1. **The score quantum $q = 1$.** Under $1/\mathrm{df}$ scoring, a
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
wide, $B = q = 1$, so a weak
|
|
61
|
-
more source-unique
|
|
74
|
+
1. **The score quantum $q = 1$.** Under $1/\mathrm{df}$ scoring, a written
|
|
75
|
+
word whose rarest matched reading lives in exactly one source weighs
|
|
76
|
+
$1/1 = 1$. That is the smallest unit of unambiguous evidence the scorer
|
|
77
|
+
can express. The weak band is one quantum wide, $B = q = 1$, so a weak
|
|
78
|
+
match gains instant ignition as soon as one more source-unique word
|
|
79
|
+
appears.
|
|
62
80
|
2. **The memory scale $\tau = 2$ turns.** Every temporal behavior below is the
|
|
63
81
|
same exponential integrator with retention $1 - 1/\tau$. The table shows
|
|
64
82
|
how the remaining constants come out:
|
package/docs/configuration.md
CHANGED
|
@@ -315,7 +315,7 @@ Mesh data defaults to `<project>/.pi/fabric/mesh`. Set `mesh.root` to a relative
|
|
|
315
315
|
|
|
316
316
|
`mesh.actorScope` controls where persistent actor definitions, mailboxes, and child sessions are stored and restored from:
|
|
317
317
|
|
|
318
|
-
- `"project"` (default) keeps a shared actor registry at `.pi/fabric/mesh/actors/`, so actors survive `/new`. The participant directory chooses each live execution owner; other sessions keep passive views and reload on takeover. Registry writes are lock-serialized and merge only locally owned actor records.
|
|
318
|
+
- `"project"` (default) keeps a shared actor registry at `.pi/fabric/mesh/actors/`, so actors survive `/new`. The participant directory chooses each live execution owner; other sessions keep passive views and reload on takeover. When the creating host's lease is gone and no live owner is advertised, a later trusted session whose residency claim matches the actor (Main for `session` actors, the resident host for `durable` actors) adopts it through a fenced registry write that rebinds `rootId`. Candidacy requires the lineage root to be provably dead in the participant directory, and concurrent starters converge on one adopter via the registry lock plus an `adoptedAt` fencing timestamp (30s grace before a freshly adopted lineage can be re-adopted, healing adopters that die before advertising). Until some host's claim matches every shared row, create/import may still refuse with "registry is owned by another host" — e.g. durable orphans wait for a resident host. Registry writes are lock-serialized and merge only locally owned actor records.
|
|
319
319
|
- `"session"` isolates actors per Pi session (under `.pi/fabric/mesh/actors/<sessionId>/`). Use this when you run concurrent Pi sessions in one project and want each to own its own actors.
|
|
320
320
|
|
|
321
321
|
`mesh.eventContextChars` bounds the sanitized JSON context attached to each host-event activation. Images are extracted before this bound, represented by redacted descriptors in actor mailboxes and the registry, and forwarded out of band to the actor runner automatically; the configured character bound does not truncate their base64.
|