pi-task-tracker 0.2.1 → 0.2.2

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.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/index.ts +6 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -75,7 +75,8 @@ Optional `taskTracker` key in `~/.pi/agent/settings.json` (all default to `true`
75
75
  - `todo` — maintain `TODO.md`
76
76
  - `readme` — maintain the `README.md` project-structure section
77
77
  - `autoCommit` — per-task commits; these are the `/rollback` checkpoints, so disabling this also disables rollback targets
78
- - `externalWrite` — policy for tool calls that would create/modify files OUTSIDE the session directory: `"block"` (default, hard deny — external changes cannot be tracked or rolled back), `"ask"` (per-attempt confirmation), `"off"` (no enforcement; `pi-permission-system` rules still apply). Reads stay free. Copying files FROM outside INTO the session is allowed (`cp` checks only its destination); moving/deleting external paths is blocked. Git history protection is **inherited**: history-rewriting git (rebase/reset/amend/force-push/clean/...) prompts for confirmation right here, so `pi-permission-system` can be uninstalled without losing that layer; routine git passes untouched, an external `git init`/`clone` is allowed with a heads-up that the new repo is not tracked. Shell commands are analyzed statically (redirects, `rm/mv/cp/touch/...`, `cd` tracking, PowerShell equivalents); git protection is inherited from `pi-permission-system` — routine git passes untouched and history-rewriting git still prompts there; only redirect targets and `-C` destinations on git segments are checked. **`cd`/`Set-Location` are disabled outright** (sandbox design: pi's bash tool runs each command in a fresh child process pinned to the session directory anyway, so a `cd` can never move the session — denying it keeps the analysis simple and the writable scope exactly the trackable scope).
78
+ - `guard` — master switch for the built-in permission layer (default `true`). Set `false` to defer permission decisions entirely to another extension (e.g. `pi-permission-system`): no external-write checks, no git-ask prompts, no cd sandbox.
79
+ - `externalWrite` — policy for tool calls that would create/modify files OUTSIDE the session directory: `"block"` (default, hard deny — external changes cannot be tracked or rolled back), `"ask"` (per-attempt confirmation), `"off"` (no enforcement; `pi-permission-system` rules still apply). Reads stay free. Copying files FROM outside INTO the session is allowed (`cp` checks only its destination); moving/deleting external paths is blocked. Everything INSIDE the session directory passes by default — the only sandbox-internal intervention is the `cd` disable. Git history protection is **inherited**: history-rewriting git (rebase/reset/amend/force-push/clean/...) prompts for confirmation right here, so `pi-permission-system` can be uninstalled without losing that layer; routine git passes untouched, an external `git init`/`clone` is allowed with a heads-up that the new repo is not tracked. Shell commands are analyzed statically (redirects, `rm/mv/cp/touch/...`, `cd` tracking, PowerShell equivalents); git protection is inherited from `pi-permission-system` — routine git passes untouched and history-rewriting git still prompts there; only redirect targets and `-C` destinations on git segments are checked. **`cd`/`Set-Location` are disabled outright** (sandbox design: pi's bash tool runs each command in a fresh child process pinned to the session directory anyway, so a `cd` can never move the session — denying it keeps the analysis simple and the writable scope exactly the trackable scope).
79
80
 
80
81
  ## Requirements
81
82
 
package/index.ts CHANGED
@@ -569,12 +569,15 @@ interface TrackerConfig {
569
569
  todo: boolean;
570
570
  readme: boolean;
571
571
  autoCommit: boolean;
572
+ /** master switch for the built-in permission layer (external-write guard,
573
+ * git-ask inheritance, cd disable). false = defer entirely to other extensions */
574
+ guard: boolean;
572
575
  /** Writes outside the session directory: "block" (default) | "ask" | "off" */
573
576
  externalWrite: "block" | "ask" | "off";
574
577
  }
575
578
 
576
579
  function readConfig(): TrackerConfig {
577
- const fallback: TrackerConfig = { todo: true, readme: true, autoCommit: true, externalWrite: "block" };
580
+ const fallback: TrackerConfig = { todo: true, readme: true, autoCommit: true, externalWrite: "block", guard: true };
578
581
  try {
579
582
  const dir = process.env.PI_CODING_AGENT_DIR || path.join(os.homedir(), ".pi", "agent");
580
583
  const file = process.env.PI_TRACKER_SETTINGS || path.join(dir, "settings.json");
@@ -584,6 +587,7 @@ function readConfig(): TrackerConfig {
584
587
  todo: t.todo !== false,
585
588
  readme: t.readme !== false,
586
589
  autoCommit: t.autoCommit !== false,
590
+ guard: t.guard !== false,
587
591
  externalWrite: t.externalWrite === "ask" || t.externalWrite === "off" ? t.externalWrite : "block",
588
592
  };
589
593
  } catch {
@@ -671,7 +675,7 @@ export default function (pi: ExtensionAPI) {
671
675
  pi.on("tool_call", async (event, ctx) => {
672
676
  // External-write guard: keep the writable scope equal to the trackable
673
677
  // scope. See the "External-write guard" block above for the policy.
674
- if (config.externalWrite !== "off") {
678
+ if (config.guard && config.externalWrite !== "off") {
675
679
  const hit = await guardExternalWriteHit(event, cwd, config.externalWrite === "off" ? "block" : config.externalWrite, ctx);
676
680
  if (hit) {
677
681
  if (hit === "__ask__") return; // ask mode: user approved in guardExternalWriteHit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-task-tracker",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Task workflow tracking for the pi coding agent: TODO/README maintenance, per-task git auto-commits as checkpoints, and an interactive /rollback. Hashline-aware, nested-repo aware, subagent-artifact-safe.",
5
5
  "keywords": [
6
6
  "pi-package",