Version-gated: the package runtime requires Node
>=22.19. Development declares Pi ^0.82.0; the lockfile and real-CLI package-load E2E use Pi 0.82.1. That is compatibility evidence, not a formal host-version range. Package load is Supported within that test boundary; the full real-host recall chain is Not validated.Maturity and installation
Pi uses the source packagepowercontext-pi version 0.0.2. It contains an extension and a bundled project-context Skill. The current setup path installs the package from the selected PowerContext Git ref or a local checkout; installation by published npm package name is currently Unsupported.
SKILL.md, runs pi install <package-directory>, removes superseded user-scoped PowerContext registrations only after success, and then runs doctor.
Remote checkout materialization uses staging and restores the previous checkout if the staging swap fails. A later pi install failure has no transactional checkout rollback. Source credentials and clone output are not printed.
powercontext doctor pi checks the Pi executable, pi list, and an installed manifest named powercontext-pi. It does not check Server readiness, extension activation, bundled-Skill discovery, package or host version, or a model turn. The general powercontext doctor covers the Server separately.
Minimal usage
Start a new Pi process after installation or environment changes. Then keep automatic and explicit paths separate:- Submit a normal coding prompt.
before_agent_startmay recall temporary context and capture the trimmed prompt as a Source. - Use the 13 native Memory and Handoff tools for exact reads or supported durable operations.
- Use
/pc,/pc doctor, and/pc search <query>for diagnostics and explicit checks./pc doctorcalls the configured Server; it is different frompowercontext doctor pi.
/pc; its hooks become no-ops. The bundled Skill describes tool usage, but real Pi Skill discovery is Not validated because the package-load E2E runs with --no-skills.
Execution flow
agent_end only starts flush and returns. No callback captures the assistant response or records Task Outcome. Pi’s session_shutdown event is not a Claude Code Stop Hook.
Scope
Pi derives Scope before each scoped Server operation:- Use non-empty
POWERCONTEXT_PI_SCOPE_ID, hashing values over 256 characters. - Otherwise resolve the Git top-level and normalize
remote.origin.urlto agit:Scope. - Fall back to
local:sha256(<absolute-project-root>).
.git noise. It accepts common HTTP, HTTPS, SSH, Git, and SCP-style remotes. Resolved promises are cached by cwd; failed resolutions are evicted. A tool caller cannot replace the derived scope_id with its own value.
Pi has no Codex- or Claude-style Workstream picker or Git-private Scope binding. That path is Unsupported.
Injection
PreparedContext is accepted only when it has exactlyschema, status, content, and content_bytes; uses powercontext.prepared-context.v1; obeys empty/ready rules; reports the exact UTF-8 byte count; and stays within the configured content bound.
The extension appends ready content to Pi’s existing systemPrompt under a host-supplied, untrusted-historical-evidence label. Empty or invalid content is not injected. This is transient augmentation, not a transcript synchronization or a new Source, Memory, or Artifact.
Capture
Automatic capture is on by default. Source identity hashes Scope, normalized session identity, derived turn number, and the trimmed prompt. Metadata is exactlyorigin, event, cwd, session_id, and turn_id. The turn number comes from the current branch’s user-message count; the branch itself is not stored.
Capture skips content when disabled, when the UTF-8 prompt exceeds 200,000 bytes, or when the prompt matches a private key, credential assignment, Bearer value, or known token shape. The dedicated multibyte boundary case is Not validated because the current oversized test uses ASCII.
A capture becomes pending only when the response contains an integer position >= 1. Source acceptance, processing position, flush completion, Candidate generation, Review, and committed Memory remain separate stages.
Flush
The pending flusher retains the greatest unprocessed position per Scope. A lower position cannot reduce it. It clears an entry only aftercurrent_cursor >= position. Concurrent flush calls share one in-flight promise, and a higher position recorded during a flush cannot be cleared by the older completion.
Defaults are: immediate flush off, at most four calls, a 4,000 ms turn HTTP budget, and a lifecycle closing budget capped at 1,000 ms. With POWERCONTEXT_PI_FLUSH_ON_CAPTURE=true, capture retries immediate transient errors; exhaustion records the position for a later boundary.
At a lifecycle boundary, a thrown Server/transport error stops that Scope’s current loop but leaves it pending for a future event. Cursor-behind responses retry up to the call limit. The flusher continues with other Scopes and never claims that Memory exists.
Compaction and immediate-failure-to-compaction retry have direct tests. Multiple Scopes, in-flight coalescing, a permanently lagging cursor, and a higher position arriving during flush are Not validated by direct Pi tests.
Tools, commands, and permission
Pi registers exactly 13 model tools. Read/non-durable tools arepc_search, pc_memory_list, pc_memory_get, pc_prepare_context, pc_handoff_prepare, pc_handoff_finalize, and pc_handoff_continue. Confirmation-gated mutations are pc_remember, pc_memory_revise, pc_memory_retire, pc_capture_source, pc_handoff_activate, and pc_handoff_commit.
/pc supports no-argument diagnostics plus doctor, search, remember, flush, and stats. It has no generic operation command, Candidate Review command, Handoff command, or Task Outcome command.
A gated mutation proceeds only after interactive confirmation. No UI returns stable confirmation_required; user denial returns cancelled; UI failure returns unavailable. None of those paths sends the write request. /pc remember and /pc flush use the same boundary. Explicit operations replace caller Scope, reject secret-bearing payloads, and return stable model-visible errors.
The no-UI contract and helper behavior are unit-tested. Actual real-host display, denial, and missing-UI behavior are Not validated by a host-process test.
Transport
The default Server ishttp://127.0.0.1:8000. Plain HTTP is allowed only for localhost and loopback addresses; remote Servers require HTTPS. Base URLs with credentials, query, fragments, or non-HTTP schemes are rejected.
POWERCONTEXT_PI_AUTHORIZATION is sent as the complete Authorization value. Redirects are handled manually and rejected, so credentials are not forwarded. Responses are capped at 1 MiB, and successful bodies must contain valid JSON. Per-request timeout and the shared turn budget are separate limits.
Unsupported vs Not validated
The real package E2E installs the directory with locked Pi 0.82.1, starts offline RPC with no session and no Skills, and checks that
/pc is registered. It does not create a session, call a model or Server, exercise recall, or load the bundled Skill.
Negative experiments
Run these before treating a Pi deployment as complete:- Break local configuration and confirm Pi keeps running with no PowerContext tools, command, or hook effects.
- Stop the Server and confirm the turn continues without injected context.
- Make prepare fail while capture succeeds; reverse the failures and retain valid recalled context.
- Submit a blank, secret-shaped, disabled-capture, or over-limit prompt and verify the expected no-op or no-capture path.
- Make immediate flush fail, trigger compaction, and confirm the pending position is retried.
- Record lower and higher positions during flush; only
current_cursor >= highest-positionmay clear the entry. - Keep the cursor behind position and confirm bounded work ends without claiming Memory exists.
- Run a mutation without UI and confirm
confirmation_requiredwith no HTTP write; decline through UI and expectcancelled. - Pass a different
scope_idto a tool and confirm the derived Scope replaces it. - Return a redirect or oversized/non-JSON response and confirm the client rejects it.
- Use plaintext on a non-loopback host and confirm configuration is rejected; use HTTPS remotely.
- Inspect tools and commands and confirm Task Outcome, Candidate Review, Experience/Skill generation, and generic API surfaces are absent.
Configuration defaults
Do not put credentials in
POWERCONTEXT_PI_BASE_URL. Use HTTPS outside loopback. Disable capture when the current work must not become Source evidence:
Finish the shared check on this host
What should happen after the OpenAPI contract changes?
- Store the answer in a stable Scope with
pc_rememberor/pc remember. With a UI, passui.confirmfirst. - Open a new session and ask the same question.
- The recall must include a Citation and appear only at the end of
systemPrompt, in the block that starts withPowerContext host-supplied context. - Stop the Server and ask an ordinary coding question. Recall, capture, and flush must not block the agent.
- With the Server still down, run
pc_rememberagain. A UI session must show the failure. Without a UI, the stable result isconfirmation_required. Do not write silently.
Completion checklist
Treat the integration as complete only when these results are observable:- PowerContext and the Pi package come from the same reviewed Git ref.
- Node is
>=22.19. - Pi 0.82.1 is recorded as compatibility evidence, not a formal minimum or complete 0.82.x promise.
- Both
powercontext doctorandpowercontext doctor pipass for their separate boundaries. pi listpoints to a package manifest namedpowercontext-pi, and a new Pi process exposes/pc./pc doctorreaches the intended Server.- Scope is the explicit override, sanitized Git identity, or local-root hash.
- Caller Scope cannot replace it.
- Valid PreparedContext is strictly checked and appended to the existing
systemPromptas untrusted evidence. - Capture stores the trimmed prompt with
cwd,session_id, and derivedturn_id, but no project or branch field. - Secret and over-200,000-byte prompts are not captured.
- Pending work clears only at
current_cursor >= positionand stays within the call and closing budgets. - Every gated tool and
/pcmutation confirms or returns a stable no-write error. - Remote transport uses HTTPS, rejects redirects, and enforces JSON and response-size bounds.
- Source, position, flush, Candidate, Review, and Memory remain distinct stages.
- Package-load evidence stays separate from bundled-Skill discovery and a full real-host turn.
- Pi-native Task Outcome and the other absent surfaces remain Unsupported.
- Bundled Skill presence does not imply managed Skill export.

