parent
66c486deb9
commit
e19272d39a
3 changed files with 0 additions and 138 deletions
|
|
@ -8,7 +8,6 @@
|
|||
{"_type":"issue","id":"islandflow-ayo","title":"Drop stale backlog events from live fanout","description":"Follow-up to live freshness rollout: /ws/live was still fanning out stale backlog events for freshness-gated channels, which kept tape panes in Live feed behind despite active synthetic ingest. Gate fanout and cache ingest by freshness for options/nbbo/equities/flow.","status":"closed","priority":1,"issue_type":"bug","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-04-28T21:26:39Z","created_by":"dirtydishes","updated_at":"2026-04-28T21:26:44Z","started_at":"2026-04-28T21:26:44Z","closed_at":"2026-04-28T21:26:44Z","close_reason":"Completed","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"islandflow-0v6","title":"Fix tape freshness, NBBO coverage, pause controls, and filter popup","description":"Implement the tape fixes requested for synthetic options notional sizing, strict live freshness, live-mode pause/resume behavior, stronger NBBO snapshot coverage, and moving flow filters behind a popup. Includes server-side live cache changes, web terminal state/UI changes, and tests for synthetic pricing, live snapshot freshness/NBBO retention, and live pause/filter interactions.","status":"closed","priority":1,"issue_type":"task","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-04-28T21:02:52Z","created_by":"dirtydishes","updated_at":"2026-04-28T21:13:38Z","started_at":"2026-04-28T21:02:57Z","closed_at":"2026-04-28T21:13:38Z","close_reason":"Completed","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"islandflow-e4r","title":"Implement smart-money flow filtering and synthetic firehose modes","description":"Implement the approved multi-surface plan for named synthetic market profiles, options raw-vs-signal filtering, live/API filter contracts, Tape page client-side flow filters, firehose-readiness improvements, tests, and README updates.","status":"closed","priority":1,"issue_type":"feature","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-04-28T20:10:49Z","created_by":"dirtydishes","updated_at":"2026-04-28T20:29:29Z","started_at":"2026-04-28T20:10:53Z","closed_at":"2026-04-28T20:29:29Z","close_reason":"Implemented synthetic market profiles, options signal-path filtering, signal-aware API/replay contracts, Tape page filters, tests, and README updates. Follow-up tracked in islandflow-biq.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"islandflow-hio","title":"Add Pi /plan command for plan mode","description":"Create a Pi extension so typing /plan activates plan mode instructions and guards against implementation file edits until disabled.","status":"closed","priority":2,"issue_type":"task","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-05-15T04:56:00Z","created_by":"dirtydishes","updated_at":"2026-05-15T04:57:03Z","started_at":"2026-05-15T04:56:03Z","closed_at":"2026-05-15T04:57:03Z","close_reason":"Implemented project-local Pi /plan extension with plan-mode guardrails.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"islandflow-t8s","title":"Reconcile merge conflicts on impeccable","description":"Resolve the PR branch conflicts against main while preserving terminal hardening, responsive adaptation, and related test coverage.","status":"closed","priority":2,"issue_type":"task","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-05-14T22:32:40Z","created_by":"dirtydishes","updated_at":"2026-05-14T22:34:03Z","started_at":"2026-05-14T22:33:05Z","closed_at":"2026-05-14T22:34:03Z","close_reason":"Rebased impeccable onto main, resolved the terminal test conflict, and revalidated the web app.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"islandflow-7ch","title":"Reconcile merge conflicts on impeccable","description":"Resolve the current merge or rebase conflicts on the impeccable branch and preserve the intended terminal UI and documentation changes.","status":"in_progress","priority":2,"issue_type":"task","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-05-14T22:30:10Z","created_by":"dirtydishes","updated_at":"2026-05-14T22:30:29Z","started_at":"2026-05-14T22:30:29Z","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"islandflow-1f5","title":"Adapt terminal view for responsive use","description":"Improve the terminal view so it remains usable across desktop, tablet, and small-screen contexts without hiding core workflow functionality.","status":"closed","priority":2,"issue_type":"task","assignee":"dirtydishes","owner":"dishes@dpdrm.com","created_at":"2026-05-14T22:22:18Z","created_by":"dirtydishes","updated_at":"2026-05-14T22:25:22Z","started_at":"2026-05-14T22:22:25Z","closed_at":"2026-05-14T22:25:22Z","close_reason":"Terminal view adapted for responsive and touch-first contexts; tests and web build passed.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
|
|
|
|||
|
|
@ -1,82 +0,0 @@
|
|||
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||
import { isToolCallEventType } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
const PLAN_MODE_PROMPT = `PLAN MODE IS ACTIVE.
|
||||
|
||||
You must not modify code, configuration, tests, documentation, project files, or external files. Do not use write or edit tools. Do not run shell commands that create, modify, delete, move, format, install, commit, push, or otherwise mutate files, dependencies, services, or repository state.
|
||||
|
||||
You may inspect files and run read-only discovery commands. Produce a concise implementation plan, include risks and validation steps, then ask the user whether they want to proceed with implementation. If the user asks to save the plan, create only a plan document under docs/plans/ after explicitly confirming that saving the plan is allowed.`;
|
||||
|
||||
let planMode = false;
|
||||
|
||||
function looksMutatingShell(command: string): boolean {
|
||||
const normalized = command.toLowerCase();
|
||||
const mutatingPatterns = [
|
||||
/(^|[;&|()\s])(>|>>|tee\b)/,
|
||||
/(^|[;&|()\s])(rm|rmdir|mv|cp|mkdir|touch|chmod|chown|ln|truncate)\b/,
|
||||
/(^|[;&|()\s])(git\s+(add|commit|push|pull|merge|rebase|reset|checkout|switch|restore|stash|clean|tag|branch)|bd\s+(create|update|close|reopen|dolt\s+push))\b/,
|
||||
/(^|[;&|()\s])(bun|npm|pnpm|yarn|npx)\s+(install|add|remove|update|upgrade|dedupe|run\s+(build|dev|format|lint:fix))\b/,
|
||||
/(^|[;&|()\s])(python|python3|node|ruby|perl)\b.*\b(-w|writefile|appendfile|unlink|rmdir|mkdir|rename)\b/,
|
||||
/(^|[;&|()\s])(docker|docker-compose)\s+(run|compose\s+up|up|down|rm|rmi|build|push|pull)\b/,
|
||||
];
|
||||
|
||||
return mutatingPatterns.some((pattern) => pattern.test(normalized));
|
||||
}
|
||||
|
||||
export default function planModeExtension(pi: ExtensionAPI) {
|
||||
pi.registerCommand("plan", {
|
||||
description: "Activate plan mode. Use '/plan off' to return to implementation mode.",
|
||||
handler: async (args, ctx) => {
|
||||
const command = args.trim().toLowerCase();
|
||||
|
||||
if (["off", "disable", "disabled", "false", "0"].includes(command)) {
|
||||
planMode = false;
|
||||
ctx.ui.setStatus("plan-mode", undefined);
|
||||
ctx.ui.notify("Plan mode disabled. Implementation tools are available again.", "info");
|
||||
return;
|
||||
}
|
||||
|
||||
planMode = true;
|
||||
ctx.ui.setStatus("plan-mode", "PLAN");
|
||||
ctx.ui.notify("Plan mode enabled. File mutation tools and mutating shell commands are blocked.", "success");
|
||||
},
|
||||
});
|
||||
|
||||
pi.registerCommand("implement", {
|
||||
description: "Disable plan mode and return to implementation mode.",
|
||||
handler: async (_args, ctx) => {
|
||||
planMode = false;
|
||||
ctx.ui.setStatus("plan-mode", undefined);
|
||||
ctx.ui.notify("Plan mode disabled. Implementation mode is active.", "info");
|
||||
},
|
||||
});
|
||||
|
||||
pi.on("session_start", async (_event, ctx) => {
|
||||
if (planMode) ctx.ui.setStatus("plan-mode", "PLAN");
|
||||
});
|
||||
|
||||
pi.on("before_agent_start", async (event) => {
|
||||
if (!planMode) return;
|
||||
return {
|
||||
systemPrompt: `${event.systemPrompt}\n\n${PLAN_MODE_PROMPT}`,
|
||||
};
|
||||
});
|
||||
|
||||
pi.on("tool_call", async (event) => {
|
||||
if (!planMode) return;
|
||||
|
||||
if (event.toolName === "write" || event.toolName === "edit") {
|
||||
return {
|
||||
block: true,
|
||||
reason: "Plan mode is active. Use /plan off or /implement before modifying files.",
|
||||
};
|
||||
}
|
||||
|
||||
if (isToolCallEventType("bash", event) && looksMutatingShell(event.input.command ?? "")) {
|
||||
return {
|
||||
block: true,
|
||||
reason: "Plan mode is active. Mutating shell commands are blocked. Use /plan off or /implement to proceed.",
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Add Pi /plan Mode</title>
|
||||
<style>
|
||||
body { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; margin: 2rem auto; max-width: 860px; color: #1f2520; background: #fbfaf6; }
|
||||
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
||||
pre { background: #ece8dd; padding: 1rem; overflow-x: auto; border-radius: 12px; }
|
||||
h1, h2 { line-height: 1.15; }
|
||||
.summary { background: #e4eadf; border: 1px solid #cbd8c0; border-radius: 16px; padding: 1rem 1.25rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Add Pi <code>/plan</code> Mode</h1>
|
||||
<section class="summary">
|
||||
<h2>Summary</h2>
|
||||
<p>Added a project-local Pi extension that lets users type <code>/plan</code> to activate a guarded planning mode, then <code>/plan off</code> or <code>/implement</code> to return to implementation mode.</p>
|
||||
</section>
|
||||
|
||||
<h2>Changes Made</h2>
|
||||
<ul>
|
||||
<li>Created <code>.pi/extensions/plan-mode.ts</code>.</li>
|
||||
<li>Registered a <code>/plan</code> command that enables plan mode.</li>
|
||||
<li>Registered a <code>/implement</code> command and <code>/plan off</code> argument to disable plan mode.</li>
|
||||
<li>Added tool-call guards that block <code>write</code>, <code>edit</code>, and common mutating shell commands while plan mode is active.</li>
|
||||
<li>Added a turn document for this change.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Context</h2>
|
||||
<p>Pi does not ship with built-in plan mode. Its documented extension system supports custom slash commands and tool-call interception, which fits this workflow without patching Pi internals.</p>
|
||||
|
||||
<h2>Important Implementation Details</h2>
|
||||
<pre><code>/plan # enable planning guardrails
|
||||
/plan off # disable planning guardrails
|
||||
/implement # disable planning guardrails</code></pre>
|
||||
<p>When active, plan mode appends explicit system instructions before each agent turn and blocks file mutation tools. Bash commands are screened with conservative patterns for filesystem, git, package-manager, and Docker mutations.</p>
|
||||
|
||||
<h2>Validation</h2>
|
||||
<ul>
|
||||
<li>Ran <code>NODE_PATH=/opt/homebrew/lib/node_modules bun --check .pi/extensions/plan-mode.ts</code> successfully.</li>
|
||||
<li>Initial <code>bun --check .pi/extensions/plan-mode.ts</code> failed because the Pi package is installed globally, not as a repo dependency. Retried with <code>NODE_PATH</code> pointed at Homebrew global Node modules.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Issues, Limitations, and Mitigations</h2>
|
||||
<ul>
|
||||
<li>The bash mutation detector is intentionally conservative but cannot perfectly classify every shell command. Direct Pi <code>write</code> and <code>edit</code> calls are fully blocked.</li>
|
||||
<li>The extension is project-local, so it activates automatically for Pi sessions launched in this repository. To use it everywhere, copy it to <code>~/.pi/agent/extensions/</code>.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Follow-up Work</h2>
|
||||
<p>No required follow-up work. Beads issue: <code>islandflow-hio</code>.</p>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue