omp packages

pi-fabric-continuity0.3.4

Continual harness for pi on fabric primitives: provider-owned journal of self-improving notes/principles, exposed as the `continuity` FabricProvider and callable from fabric_exec.

GitHub Actions Published 22 days ago ISC ~379 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-fabric-continuity

npm checks license

Continual harness for pi, built on pi-fabric primitives: self-improving prompt notes, principles, skill descriptions, and sub-agent specs — with a refine loop and no manual import/export of a durable file.

Successor to the pi-continual-harness concept, re-architected per The Harness Playbook: one authority (an append-only journal), state derived by folding, /tree-correct trajectory reads.

How it fits

The roles around the model boundary are deliberately separate:

  • pi-fabric executes and orchestrates; its compaction engine writes the deterministic summary.
  • pi-context-engineer decides what data may cross a single call boundary.
  • pi-vcc preserves the raw lineage that compaction removes.
  • continuity governs the identity boundary: which distilled claims about the operator, the project and the harness itself ride into every system prompt — kept honest by a journaled, evidence-backed self-improvement loop.

Lineage & inspirations

  • The Continual Harness — the four components (prompt / memory / skill / subagent) this package implements.
  • The Harness Playbook — one authority, folding, /tree-correct reads (already linked above; it shaped the architecture).
  • prime-agent — the refine loop: trajectory evidence → proposed deltas → journaled, revertible transitions.
  • ACE (Agentic Context Engineering) — structured, evidence-backed CRUD deltas instead of prose rewrites; the Delta type is ACE-shaped on purpose.
  • pi-vcc — sticky sections and stable-first ordering; our emission order is prompt-cache-stable for the same reason.
  • pi-context-engineer — boundary governance; continuity extends that philosophy to the identity boundary.
  • pi-reflect and pi-mem — surveyed in docs/domain-map.md.

Install

Requires pi >= 0.85 with the pi-fabric extension installed.

pi install npm:pi-fabric-continuity

Or from the repo directly:

pi install git:github.com/e4779/pi-fabric-continuity

Or drop a symlink into ~/.pi/agent/extensions/ for development:

ln -s ~/projects/pi-fabric-continuity ~/.pi/agent/extensions/pi-fabric-continuity

Usage

/harness status            # journal versions + item counts (project & global)
/harness list [kind]       # items, optionally filtered by prompt|memory|skill|subagent
/harness search <query>   # case-insensitive literal search over current and historical items
/harness stats            # per-item injection/touch counters + decay eligibility
                          # AND historical journal text (old versions, deleted);
                          # hits carry id, version/ts, bounded snippet
/harness audit [--apply]   # deterministic staleness check: paths/packages vs the live machine
/harness history [n]       # recent journal transitions (who/when/why)
/harness refine [lookback] [instructions]
                          # trajectory evidence -> LLM proposer -> journaled deltas;
                          # /refine is an alias. Free text after the optional
                          # number focuses the proposer (e.g. /refine git discipline)
/harness keep|drop <id>    # importance hygiene (+/-0.1, as transitions)
/harness revert <version>  # compensating deltas; the journal is never rewritten

All subcommands, kinds, item ids, and journal versions autocomplete.

The same surface is a first-class fabric provider: any fabric_exec program (including spawned durable agents) can call tools.call({ ref: "continuity.mutate", args: { deltas: [...] } }) with fabric-side validation, risk policy, and nested-call audit. continuity.search is the same search as /harness search as a read-risk action: { query, scope?, cwd? } — literal, case-insensitive, no LLM. continuity.stats is the read-risk view behind /harness stats: per-item injection/touch counters with decay eligibility (see F1 attribution counters).

Auto-refine cadence and refine evidence (opt-in):

// ~/.pi/agent/continuity/config.json
{ "autoRefine": { "enabled": true, "everyTurns": 50 }, "vccEvidence": false }

"vccEvidence": true feeds the refine proposer a bounded, labeled section of vcc_recall output (queries derived from the project directory, ~2k char cap). Requires @monotykamary/pi-vcc; when it is absent or the call fails, refine proceeds unchanged.

The daily loop

Three roles, one journal:

  1. Refine — every N turns (opt-in autoRefine) or on demand (/harness refine), the pipeline reads the recent trajectory and proposes evidence-backed deltas. Repeated patterns, durable facts, and stale items become journal transitions.
  2. The model self-corrects — active items are injected into the system prompt each turn (importance-ordered, token-budgeted). When the model notices an item is wrong or stale mid-session, it updates it directly via continuity.mutate from any fabric_exec program — no waiting for the human.
  3. You curate — /harness keep/drop to steer importance, /harness history to audit who changed what and why, /harness revert <v> to undo a bad refine. Every mutation is journaled; nothing happens outside the audit trail.

Scopes: project per working directory (default) and global for cross-project principles. The refine proposer decides per delta (it sees both stores and the scope rules); explicit calls can pin scope per delta or per batch. Global items inject into every project.

Storage

Provider-owned append-only journals, one authority, snapshots derived by folding:

~/.pi/agent/continuity/global/journal.jsonl
~/.pi/agent/continuity/projects/<slug>/journal.jsonl

Scopes: project (default, slug from cwd) and global. Items carry an optional models hint for relevance — never ownership, never blank-slate resets.

Design

Probes (no framework needed):

npm run -s typecheck || npx tsc --noEmit -p tsconfig.json
tsc -p tsconfig.build.json && node tests/journal.probe.mjs && node tests/completions.probe.mjs && node tests/refine.probe.mjs

License

ISC — the OpenBSD-style license.