You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
Repository navigation
Commit 7557ff5
Browse filesBrowse the repository at this point in the historyBrowse files
The blind release-audit council (bg_802b7aa6) returned NO-SHIP with 2 High
blockers, both verified against current source. The cache-stability core, the
restart history-loss fix, Pi mid-turn drain, and decay-render were all verified
clean — these are the remaining gaps in this cycle's own hardening work.
HIGH cortexkit#2 — sidekick.system_prompt reprogramming bypass:
AGENT_ESCALATION_FIELDS stripped prompt/permission/tools from untrusted project
configs but NOT system_prompt. sidekick/agent.ts reads config.system_prompt
BEFORE config.prompt, so a cloned repo could reprogram the hidden sidekick agent
via /ctx-aug — the exact vector the prompt strip closes. Added system_prompt to
AGENT_ESCALATION_FIELDS (shared core, both harnesses).
HIGH cortexkit#1 — Pi emergency-recovery never disarms:
OpenCode clears needs_emergency_recovery when an overflow armed it but there is
no eligible pre-tail history to compact (transform.ts:745), preventing a
permanent 95% abort loop. Pi only used hasEligiblePiCompartmentHistory() to gate
historian SPAWN, never to disarm — so a short/exhausted Pi session that
overflowed looped forever. Mirrored OpenCode's disarm in the Pi emergency block
(no in-flight historian + no eligible history => clearEmergencyRecovery,
preserving detectedContextLimit).
MED cortexkit#3 — embedding key dropped on endpoint PRESENCE not CHANGE:
dropInheritedEmbeddingKeyOnRedirect dropped the inherited api_key whenever a
project named embedding.endpoint, even if it repeated the user's OWN endpoint
(e.g. only to change model) — a benign config then 401s. Now threads the user
config and drops the key only when the endpoint actually differs (trailing-slash
+ case normalized). Falls back to the conservative presence-based drop when the
user config is unavailable. Both harness call sites updated.
MED cortexkit#4 — stale compaction markers never reconciled on node:sqlite:
checkCompactionMarkerConsistency used .get() !== null to test row existence.
Verified empirically: bun:sqlite .get() returns null for a missing row (OpenCode
CLI/server worked), but node:sqlite returns undefined (Pi AND OpenCode Desktop)
— so !== null was always true and orphaned marker state was never cleared.
Switched to != null (catches both). The audit misattributed this to bun:sqlite;
it is a genuine Desktop/Pi bug.
Tests: +3 project-security (system_prompt strip, same-endpoint keeps key,
differing-endpoint drops key). plugin 1880/0, Pi 413/0, tsc + biome clean both.
Release notes updated to match (system_prompt named, cortexkit#3 wording refined, cortexkit#4
marker reconciliation added).
Co-authored-by: Alfonso [Magic Context] <[email protected]>
Copy file name to clipboardExpand all lines: .alfonso/release-notes/v0.22.5.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@ A correctness-and-hardening patch from a deep audit sweep across the plugin, Pi,
7
7
A project-level config (`.opencode/magic-context.jsonc`, `.pi/magic-context.jsonc`) and project files are attacker-controlled the moment you open a cloned repo. These close gaps where that input reached too far:
8
8
9
9
-**Project configs can no longer expand `{env:...}` / `{file:...}` on Pi.** OpenCode already blocked this (project configs must not read your environment variables or arbitrary files); Pi had the same guard missing. A cloned repo can no longer exfiltrate secrets through a project config on either harness.
10
-
-**Your embedding API key is no longer sent to an endpoint a project config redirected.** If a project config overrides the embedding `endpoint`or `provider`, the user-level API key is no longer inherited along with it — so a repo can't point the endpoint at its own server and collect your key. Normal projects (which don't touch the endpoint) keep working unchanged.
11
-
-**A repo can no longer reprogram the hidden agents.** Project configs can no longer override the historian/dreamer/sidekick `prompt`, `permission`, or tool set. This matters most for the dreamer, which runs autonomously in the background with shell access — a cloned repo must not be able to rewrite its instructions or widen its permissions.
10
+
-**Your embedding API key is no longer sent to an endpoint a project config redirected.** If a project config points the embedding `endpoint`at a *different* server without supplying its own key, the user-level API key is no longer inherited along with it — so a repo can't redirect the endpoint to its own server and collect your key. A project that only repeats your own endpoint (e.g. to change the model) keeps working unchanged.
11
+
-**A repo can no longer reprogram the hidden agents.** Project configs can no longer override the historian/dreamer/sidekick `prompt`, `system_prompt`, `permission`, or tool set. This matters most for the dreamer, which runs autonomously in the background with shell access — a cloned repo must not be able to rewrite its instructions or widen its permissions.
12
12
-**Project-docs files are symlink-guarded and size-capped.** The files rendered into your context as `<project-docs>` are now rejected if they're symlinks (so a repo can't point `ARCHITECTURE.md` at `~/.ssh/...`) and are bounded in size.
13
13
-**Embedding requests have an SSRF guard.** Requests to cloud-metadata / link-local addresses are blocked, while localhost and LAN embedding servers (LM Studio, Ollama, etc.) keep working.
14
14
-**Local RPC endpoints now require a per-process token** (used by the TUI), compared in constant time, and the auto-update path validates the version string before touching `package.json`.
@@ -21,6 +21,7 @@ A project-level config (`.opencode/magic-context.jsonc`, `.pi/magic-context.json
21
21
-**`ctx_search` no longer surfaces your current prompt** (#131). On a session with no compartments yet, search could return the live conversation tail (already in your context). It's now excluded.
22
22
-**Interrupted upgrades render correctly.** Compartments left half-converted by an interrupted `/ctx-session-upgrade` rendered as empty blocks, dropping their content; they now fall back to their stored summary.
23
23
-**A single bad config value no longer wipes a whole section.** Previously one invalid nested field (e.g. under `memory`) reset the entire block to defaults, silently discarding your other valid settings in it. Recovery now repairs only the invalid field and keeps the rest.
24
+
-**Stale compaction markers are reconciled on Desktop and Pi.** A startup consistency check that clears orphaned compaction-boundary state never fired on the Desktop/Pi runtime (a missing-row check that worked under OpenCode's SQLite returned the wrong result under Node's), so stale boundary state could linger; it's now cleared correctly on all runtimes.
0 commit comments