Architecture Decision Records
The decisions that shape this project. Each ADR records the context, the chosen option, and the options that were considered.
| ADR | Decision |
|---|---|
| 0001 | Embed codegraph in-process, not via daemon or CLI. |
| 0002 | Per-worktree index, seeded from a sibling worktree. |
| 0003 | Named project roots for dependency sources. |
| 0004 | Context window cap via provider re-registration. |
| 0005 | Quota extension refreshes the ChatGPT token itself. |
| 0006 | Model router resumes a quota-halted turn with a synthetic user message. |
| 0007 | Sync authenticates with the OAuth device flow and expiring tokens. |
| 0008 | Usage reports are derived from session files, not a stored index. |
| 0009 | Usage events are counted once, keyed by the full session line. |
| 0010 | Gist names percent-encode sync paths, and empty files are absent. |
| 0011 | Pruning is a request-level projection; the session file is the store. |
| 0012 | Resource toggles write the native settings override patterns. |
| 0013 | The skill tree tracks upstream sources with per-source pins. |
| 0014 | Tool usage counts are derived from a session scan with a per-file stat-keyed cache. |
| 0015 | Compression is a request-time view; the compressed form is text. |
| 0016 | Dependency indexes build on first query, with streamed progress. |
| 0017 | Docs screenshots render by a capture pipeline; none is taken by hand. |
| 0018 | Pruning engagement is sticky for the session; it holds until a reset. |
| 0019 | The fallback window self-heals via a one-shot re-resolution after the model's wake. |
| 0020 | Edit assist corrects failing edit calls by mutating tool input; it never writes files. |
| 0021 | /ctx shows the default base prompt as split rows: boilerplate, snippets, one row per guideline. |
| 0022 | /ctx flags guidelines that largely restate a sent tool description, with a conservative substring rule. |
| 0023 | Background jobs keep state on disk, per job: the exit code is written by a shell wrapper, and the tools are active by default. |
| 0024 | The bash_bg tool row shows the plain command line, with no background marker. |
| 0025 | The Safe branch summary replaces the built-in branch summarizer and budgets against the Effective window divided by the Inflation factor. |
| 0026 | Output limits bounds tool results downward in the tool_result hook; it is one-directional and lossless or it does not cut. |
| 0027 | Llama refresh heals any window drift by comparing the catalog before and after one forced refresh, at two fixed heal moments; the fallback sentinel is no longer the gate. |
| 0028 | The output-starvation guard judges one request's output budget against the Effective window, keyed on pi's own clamp: it refuses a budget at pi's saturated floor (one line and the run's abort, at most once per turn), and it fits an overrunning budget to the room the Corrected estimate leaves. The guard never raises a budget. |
| 0029 | Package toggles write the packages-array filter, not resource-array patterns; the old resource-array write is a no-op that heals itself on the next toggle. |
| 0030 | Resource descriptions are read from the source file: frontmatter for a skill or prompt template, the leading block comment for an extension, nothing for a theme. |
| 0031 | A same-model re-select is read from the transcript's model_change entry at the next turn start, with a self-guard so the extension's own re-apply never re-arms itself. |
| 0032 | skill-migrate runs sequential repo-structure migrations; each target repo commits an append-only changelog that audits every completed step, and git is the rollback layer. |
| 0033 | Skill command rewrites a newline-separated /skill: command to the single-space form in the input event; pi keeps owning the expansion. |
| 0034 | The vendored antislop core is edited in two places only: its self-install and self-update sections are cut, and an unresolved usage mode defaults to during instead of asking. |